There are a few differences. `cap run httpd` works very much like `ssh host httpd` but it differs in a few ways:
It doesn't claim to be an interactive terminal. Anything that behaves differently for interactive use and non-interactive use will use the non-interactive behavior for Capistrano. By default, `sudo` asks for passwords on interactive terminals but never tries asking a non-terminal. Check your security logs to see if this is happening to you. Capistrano doesn't use the `ssh` command under the covers -- Capistrano uses the Ruby library `Net::SSH` instead of the C OpenSSH code. If your SSH configuration uses some of OpenSSH more advanced features (like proxies or X11 forwarding) they may not work the same under Ruby's Net::SSH. A useful debugging trick: compare the results of `ssh myhost env` against the results of `cap run env`. That will show any differences in environment variables. Likewise, you can compare the results of `whoami` or `pwd`. If everything is still the same, running something with `sudo`. Good luck finding the difference! -- Rob Hunter (typed with my thumbs) On May 21, 2012 6:14 AM, "赵 耀" <[email protected]> wrote: > I use capistrano to deploy my java app which is deployed to a resin server. > When I use > run "/path/to/resin/bin/httpd.sh restart" > I just got logs said the server was shuting down, but the server was never > started. > > But when I use > ssh $host "/path/to/resin/bin/httpd.sh restart" > from command line, it works just fine. > > So what is the difference? > > > > > Best regards. > > -- > * You received this message because you are subscribed to the Google > Groups "Capistrano" group. > * To post to this group, send email to [email protected] > * To unsubscribe from this group, send email to > [email protected] For more options, visit this > group at http://groups.google.com/group/capistrano?hl=en -- * You received this message because you are subscribed to the Google Groups "Capistrano" group. * To post to this group, send email to [email protected] * To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/capistrano?hl=en
