I don't know if I'm understanding your problem correctly.... but   
commands will be executed by the "runner".  So... in my set up, my ssh  
user and my runner are the same, so I have it set to:

set :user, "deployer"
set :runner, user

and "deployer" in this case would have sudo privs.  If you just want  
to run a single command with sudo, you can go

sudo "command string", :as => "user"

and it will run the command as whomever is specified with ":as".

:use_sudo is set to true by default, so commands will automatically be  
run with sudo if they need them...

:run_method will also in most cases default to :sudo, so... I really  
don't know where your problem is coming from.

Any clarification as to your actual deploy error would be great.

On Jun 5, 2008, at 8:53 AM, magpie wrote:

>
> I understand with Capistrano you're supposed  to be able to script
> remote shell commands independant of whether sudo should be used and
> what user. The other day my deploy task was working fine using the run
> method as the root user.
>
> Then the sysadmin wanted me to use another user and sudo, and I
> couldn't for love or money get my calls to run() to use sudo on the
> server. I played with run_method, use_sudo, try_sudo etc.
>
> So,
> 1) What variable(s) should I be setting to enable or disable sudo
> prefixing ? run_method ? use_sudo ? something else ?
> 2) what is the recommended method to use for scripting commands that
> obeys the above setting ? sudo ? run? try_sudo ? something else ?
>
> I have 2 years Ruby experience and thought I knew Capistrano, but this
> stumped me. It was a deadline crunch and my brains were mostly fried
> though.
>
> Thanks for any suggestions,
>
> Gary
>
> >


--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to