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.
<br><br>To do what you want do this<br><br>sudo &lt;&lt;-CMD<br>&nbsp; sh -c &quot;cd #{current_path} &amp;&amp; mongrel_rails start&quot;<br>CMD<br><br><br>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.
<br><br>sudo &lt;&lt;-CMD<br>&nbsp; sh-c &quot;cd #{current_path} &amp;&amp; nohup mongrel_rails start &gt;/dev/null&quot;<br>CMD<br><br>Rgs<br><br>NeilW<br>