Hey all,
I have a problem that I cannot wrap my head around. I have a
capistrano task to kill my lighttpd process and restart it. Here is
the subtask, stop_lighttpd, that fails:
task :stop_lighttpd, :roles => :web do
run “kill -9 ps aux | grep lighttpd | grep #{deploy_to} | awk '{print $2}'
> /dev/null”
end
I know for a fact that when stop_lighttp is ran. The process is
indeed killed and kill should give a zero output signal. However,
capistrano, doesn’t believe that it did. Here’s what it says:
pajaro:~/Projects/m_hub/m_hub luke$ cap restart_web
loading configuration /usr/local/lib/ruby/gems/1.8/gems/
capistrano-1.1.0/lib/capistrano/recipes/standard.rb
loading configuration ./config/deploy.rb
- executing task restart_web
- executing task stop_lighttpd
- executing “kill -9
ps aux | grep lighttpd | grep /var/apps/ m_hub | awk '{print $2}'
> /dev/null”
servers: [“10.1.1.20”]
[10.1.1.20] executing command
command finished
/usr/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/capistrano/
command.rb:45:inprocess!': command "kill -9
ps aux | grep lighttpd
| grep /var/apps/m_hub | awk ‘{print $2}‘> /dev/null" failed on 10.1.1.20 (RuntimeError) from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/ capistrano/actor.rb:176:in
run’
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/
capistrano/actor.rb:425:inexecute_on_servers' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/ capistrano/actor.rb:173:in
run’
from ./config/deploy.rb:137:inload' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/ capistrano/actor.rb:125:in
stop_lighttpd’
from ./config/deploy.rb:143:inload' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/ capistrano/actor.rb:125:in
restart_web’
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/
capistrano/cli.rb:246:inexecute_recipes!' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/ capistrano/cli.rb:246:in
execute_recipes!’
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/
capistrano/cli.rb:221:inexecute!' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/ capistrano/cli.rb:12:in
execute!’
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/bin/
cap:11
from /usr/local/bin/cap:18
Any clues? Thanks in advance,
Luke