cap deploy sticks after lighty restart

8 views
Skip to first unread message

E.B. Farnum

unread,
Jul 26, 2007, 6:29:28 PM7/26/07
to Capistrano
I'm testing out capistrano 2 on a test box. It's fedora 6 with
lighttpd and fastcgi.

The standard reaper scripts weren't much use to me as I'm running
lighttpd/fastcgi. I changed task :restart in deploy.rb to the
following:

task :restart, :roles => :app, :except => { :no_release => true } do
#invoke_command "#{current_path}/script/process/reaper", :via =>
run_method
sudo "/etc/init.d/lighttpd restart"
end

When doing a "cap deploy" the deploy hangs right after restarting
lighttpd. Eventually if I hit crtl-c I get the output down below the
"** [out..." lines. Any ideas what might be causing it to hang?

* executing `deploy:restart'
* executing "sudo /etc/init.d/lighttpd restart"
servers: ["localhost"]
[localhost] executing command
** [out :: localhost]
** [out :: localhost] Stopping lighttpd:
** [out :: localhost]
** [out :: localhost] [
** [out :: localhost]
** [out :: localhost] OK
** [out :: localhost]
** [out :: localhost] ]
** [out :: localhost]
** [out :: localhost]
** [out :: localhost] Starting lighttpd:
** [out :: localhost]
** [out :: localhost] [
** [out :: localhost]
** [out :: localhost] OK
** [out :: localhost]
** [out :: localhost] ]
** [out :: localhost]
** [out :: localhost]
/usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/capistrano/command.rb:
49:in `sleep': Interrupt
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/
capistrano/command.rb:49:in `process!'
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/
capistrano/command.rb:36:in `loop'
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/
capistrano/command.rb:36:in `process!'
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/
capistrano/command.rb:11:in `process'
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/
capistrano/configuration/actions/invocation.rb:52:in `run'
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/
capistrano/configuration/connections.rb:135:in `execute_on_servers'
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/
capistrano/configuration/actions/invocation.rb:50:in `run'
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/
capistrano/configuration/actions/invocation.rb:74:in `sudo'
... 19 levels...
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/lib/
capistrano/cli/execute.rb:14:in `execute'
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.0.0/bin/cap:4
from /usr/bin/cap:18:in `load'
from /usr/bin/cap:18

Jamis Buck

unread,
Jul 26, 2007, 6:38:31 PM7/26/07
to capis...@googlegroups.com
I'm still not 100% sure why, but some processes (notably lighttpd, but
also balance and some others) are very, very sensitive to being run
within capistrano's environment. The only way I've every found to
spawn those processes successfully is to use nohup:

sudo "nohup ..."

- Jamis

E.B. Farnum

unread,
Jul 26, 2007, 6:49:14 PM7/26/07
to Capistrano
You know what, I'm a moron. I had this exact problem with lightty's
startup script before. When you run it over an ssh session, it won't
let go. It is a bug. The workaround is to add this to the line that
daemonizes lighttpd in the start section: </dev/null >/dev/null 2>&1

It is an annoying solution because you're just redirecting all useful
output to null, but it does work.

Reply all
Reply to author
Forward
0 new messages