Capistrano Command Wories

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 -9ps 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:inrun’
    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:inrun’
    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:instop_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:inrestart_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:inexecute_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:inexecute!’
    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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs