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: Ronan Amicel
Subject: Re: [Fab-user] Sudo not found on Solaris
Date: Thu, 7 Mar 2013 19:25:12 +0100

Great! Glad that I could help.

Shameless plug: I maintain a toolbox of common Fabric operations (create users, install packages...), called fabtools (http://fabtools.readthedocs.org/). Currently, it primarily supports Linux hosts, but there is already some SmartOS support. If you feel like giving it a try, I'd love your feedback on what works or not on Solaris, and any suggestions for improvement!

Regards,

Ronan Amicel



On Thu, Mar 7, 2013 at 3:35 PM, Justin Palmer <address@hidden> wrote:
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]