fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] Sudo not found on Solaris


From: Justin Palmer
Subject: Re: [Fab-user] Sudo not found on Solaris
Date: Thu, 7 Mar 2013 08:35:38 -0600

This is exactly it.  Specifying env.sudo_prefix allowed sudo to be found in /usr/local/bin.  

Thanks for your help!


On Wed, Mar 6, 2013 at 2:21 PM, Ronan Amicel <address@hidden> wrote:

On Wed, Mar 6, 2013 at 7:58 PM, Justin Palmer <address@hidden> wrote:
Trying a simple test fabfile to run a sudo command on Solaris.  Gives the results below.  The sudo path is set via .profile which I assume would be read with shell=True.  What am I missing?  


When you use run(cmd, shell=True), fabric will execute the command within a shell.

When you use sudo(cmd, shell=True), fabric will use sudo to run this shell, but the sudo call itself will not  happen within a shell context, so your .profile is not executed, and /usr/local/bin in not in the PATH.

Try adding this at the beginning of your fabfile (after imports):

env.sudo_prefix = "/usr/local/bin/sudo -S -p '%(sudo_prompt)s' "

Hope this helps.

--
Ronan Amicel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]