# Capistrano Command Wories

**URL:** <https://www.ruby-forum.com/t/capistrano-command-wories/96337>\
**Category:** Ruby\
**Created:** [June 28, 2006, 5:35am UTC](https://www.ruby-forum.com/t/capistrano-command-wories/96337 "2006-06-28T05:35:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luke\_Amdor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/848f3c/32.png) [@Luke\_Amdor](https://www.ruby-forum.com/u/Luke_Amdor)\
**Post date:** [June 28, 2006, 5:35am UTC](https://www.ruby-forum.com/t/capistrano-command-wories/96337/1 "2006-06-28T05:35:53Z")

</div>

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:in `process!': 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:in `execute_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:in `load' 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:in `load' 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:in `execute_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:in `execute!' 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
