[Mongrel] Mongrel_rails restart and sudo

Neil Wilson neil at aldur.co.uk
Fri Jun 16 12:20:04 EDT 2006

The implementation of 'sudo' in capistrano is a little flawed. It ought to
wrap the command in a 'sh -c' wrapper to make sure that the sudo privileges
apply to the entire command string and not just the first command. At the
moment you have to do that manually.

To do what you want do this

sudo <<-CMD
  sh -c "cd #{current_path} && mongrel_rails start"

The other problem is that capistrano is a little quick of the mark when
shutting down a connection - often before the last program has had a chance
to catch HUP signals. If this happens use.

sudo <<-CMD
  sh-c "cd #{current_path} && nohup mongrel_rails start >/dev/null"


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20060616/fc8ffc24/attachment.htm 

More information about the Mongrel-users mailing list