11

jenkins に奇妙な問題があります。ジョブでファイルをコピーできませんが、コマンド ラインでユーザー jenkins を使用すると、問題なくコピーできます。

ユーザー「jenkins」の下で実行されているdebianでjenkinsを使用しています。

ユーザー「jenkins」をグループ「www-data」に追加して、ファイルをapacheのwww-folderにコピーできるようにしました。

ターゲット フォルダのフォルダ権限は次のようになります。

drwxrwxr-x 9 www-data www-data 4096 Jun 23 16:19 .   
drwxrwxr-x 4 www-data www-data 4096 Jun 23 12:45 ..  
-rw-rw-r-- 1 volker   www-data  368 Jun 23 17:10 about.php  
-rw-rw-r-- 1 volker   www-data  366 Jun 23 17:10 bio.php  
-rw-rw-r-- 1 volker   www-data  370 Jun 23 17:10 contact.php   
drwxrwxr-x 3 volker   www-data 4096 Jun 23 16:19 content  
drwxrwxr-x 3 volker   www-data 4096 Jun 23 16:19 css  
drwxrwxr-x 8 volker   www-data 4096 Jun 23 16:19 default  
drwxrwxr-x 3 volker   www-data 4096 Jun 23 16:19 fonts  
drwxrwxr-x 2 volker   www-data 4096 Jun 23 13:40 image  
drwxrwxr-x 3 volker   www-data 4096 Jun 23 16:19 images  
-rw-rw-r-- 1 volker   www-data  372 Jun 23 17:10 impressum.php  
-rw-rw-r-- 1 volker   www-data  367 Jun 23 17:10 index.php  
-rw-rw-r-- 1 volker   www-data  296 Jun 23 13:52 kontakt.php  
drwxrwxr-x 3 volker   www-data 4096 Jun 23 16:19 layout   
-rw-rw-r-- 1 volker   www-data  367 Jun 23 17:10 news.php  
-rw-rw-r-- 1 volker   www-data  370 Jun 23 17:10 termine.php  
-rw-rw-r-- 1 volker   www-data  369 Jun 23 17:10 videos.php  

したがって、すべてがグループ www-data に対して書き込み可能です。

jenkins ユーザーを使用してシェル内のファイルをコピーすると、エラーは発生しません。

jenkins@rootserver:~/jobs/deploy_notundellende/workspace$ whoami  
jenkins  
jenkins@rootserver:~/jobs/deploy_notundellende/workspace$ cp -R * /var/www/nue  
jenkins@rootserver:~/jobs/deploy_notundellende/workspace$   

しかし、jenkins 自体で同じコマンドを使用すると、アクセス許可エラーで失敗します。

pwd  
/var/lib/jenkins/jobs/deploy_notundellende/workspace  
whoami  
jenkins  
cp -R about.php bio.php contact.php content css fonts images impressum.php index.php   layout news.php termine.php videos.php /var/www/nue  
cp: cannot create regular file `/var/www/nue/about.php': Permission denied  
cp: cannot create regular file `/var/www/nue/bio.php': Permission denied  
cp: cannot create regular file `/var/www/nue/contact.php': Permission denied  
cp: cannot create regular file `/var/www/nue/content/videos.php': Permission denied  

そんなことがあるものか?誰にもアイデアはありますか?

4

2 に答える 2

14

OK、動作するようになりました。jenkins サーバーを再起動したところ、動作しました。権限を変更したときにジェンキンスサーバーがすでに実行されていたため、以前は機能しなかったと思います。今、私には理にかなっています、考えてみてください:) とにかく、これを読んで考えてくれた人に感謝します!

于 2013-06-24T08:53:52.500 に答える