2013-10-21 63 views
0

我试图使用命令RUBBER_ENV=staging FILTER=staging cap rubber:unicorn:restart重新启动麒麟,但我发现了以下错误:无法重新启动麒麟

triggering load callbacks 
* 2013-10-21 11:49:47 executing `rubber:init' 
** Auto role: app => staging.x.com, {:platform=>"linux"} 
** Auto role: unicorn => staging.x.com, {:platform=>"linux"} 
** Auto role: nginx => staging.x.com, {:platform=>"linux"} 
** Auto role: collectd => staging.x.com, {:platform=>"linux"} 
** Auto role: common => staging.x.com, {:platform=>"linux"} 
** Auto role: monit => staging.x.com, {:platform=>"linux"} 
** Auto role: db => staging.x.com, {:primary=>true, :platform=>"linux"} 
** Auto role: postgresql => staging.x.com, {:platform=>"linux"} 
** Auto role: postgresql_master => staging.x.com, {:platform=>"linux"} 
** Auto role: examples => staging.x.com, {:platform=>"linux"} 
** Auto role: graphite_server => staging.x.com, {:platform=>"linux"} 
** Auto role: graphite_web => staging.x.com, {:platform=>"linux"} 
** Auto role: memcached => staging.x.com, {:platform=>"linux"} 
** Auto role: web => staging.x.com, {:platform=>"linux"} 
** Auto role: web_tools => staging.x.com, {:platform=>"linux"} 
* 2013-10-21 11:49:50 executing `rubber:unicorn:restart' 
* 2013-10-21 11:49:50 executing `rubber:unicorn:stop' 
* executing "sudo -p 'sudo password: ' bash -l -c 'if [ -f /var/run/unicorn.pid ]; then pid=`cat /var/run/unicorn.pid` && kill -TERM $pid; fi'" 
servers: ["staging.voylla.com"] 
connection failed for: staging.x.com (Net::SSH::AuthenticationFailed: root) 

一些research ponted了几件事情,但我在后,甚至得到错误在我deploy.rb以下设置:

set :ssh_options, {:auth_methods => "publickey"} 
set :ssh_options, {:keys => ["~/voylla.pem"]} 

我甚至尝试了方案中提到here。但是这也行不通。

有人可以请帮忙。谢谢

回答

0

无论** Auto role: web_tools => staging.x.com, {:platform=>"linux"}是做它不是操作系统Capistrano。

问题是sudo无法在没有密码的情况下更改为超级用户帐户,因此系统会提示您。在Capistrano 2.x中,您可以看到提示,但无法回答它(即您输入的任何内容只是由于输入处理的奇怪而被无意发送)

我建议的修复方法是确保您的部署用户可以在不需要密码的情况下致电sudo,或更改您的脚本,以便可以调用的setuid脚本封装此逻辑。

+0

我做'须藤visudo'并添加行'用户名ALL =(ALL)NOPASSWD:ALL'底部如[在这里]所述(http://askubuntu.com/questions/147241/execute-sudo-without-password)。但它没有奏效。我得到了同样的错误 – nish

+0

如果你做了什么工作,错误至少会改变,因为'*执行“sudo -p'sudo密码:'bash'不会被打印了 –

+0

我使用'sudo su'。它不提示输入密码,所以我想我在这里丢失了别的东西 – nish

0

上.pem文件.pem文件添加到~/.ssh文件夹,然后做一个ssh-add