Re: [Fab-user] noprofile

2010-08-16 Thread Jeff Forcier
Hi Brett,

On Sat, Aug 14, 2010 at 5:19 AM, Brett Haydon  wrote:

> Wouldn't it be more efficient to use the --noprofile option by default or 
> perhaps  have it as an env, sudo, run option?

Thus far I've been operating on the principle that the average user is
going to expect the remote end to "behave" in a similar fashion to an
interactive SSH session to the same box, w/r/t $PATH and other
exported vars -- thus the use of the -l flag (which is what forces a
login shell and thus sources .bashrc, .bash_profile etc).

And since env.shell is user-editable (as you found out) that provides
a quick and easy way for "power users" to disable the sourcing of
login files when that presents problems for them.

> BTW I did try using env.shell=False but quite a few of my functions failed so 
> gave that idea away.

Yea, turning the shell off entirely is typically less desirable --
it's best to remove the "-l" instead (which would prevent sourcing of
either bashrc OR profile files). Depending on your intent you might
actually want to do that instead of adding the "--noprofile".

Best,
Jeff

>
> cheers,
>
> Brett
>
>
> ___
> Fab-user mailing list
> Fab-user@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/fab-user
>



-- 
Jeff Forcier
Unix sysadmin; Python/Ruby developer
http://bitprophet.org

___
Fab-user mailing list
Fab-user@nongnu.org
http://lists.nongnu.org/mailman/listinfo/fab-user


[Fab-user] noprofile

2010-08-16 Thread Brett Haydon
Hi,

I ran into an issue with using a combination of virtualenvwrapper with fabric 
sudo command. Logging in virtualenvwrapper can end up creating hook.log that is 
only accessible by root, and cause errors trying to source the 
virtualenvwrapper.sh as the normal env.user.

I've ended up using env.shell = '/bin/bash --noprofile -l -c' to workaround the 
issue but it occurs to me that --noprofile is actually a pretty good option to 
use by default. Scanning the .bashrc and .profile in Ubuntu, I can't actually 
see the advantage of using them with fabric run or sudo anyway, since they 
appear to make things nice for humans using the shell.

Wouldn't it be more efficient to use the --noprofile option by default or 
perhaps  have it as an env, sudo, run option?
BTW I did try using env.shell=False but quite a few of my functions failed so 
gave that idea away.

cheers,

Brett


___
Fab-user mailing list
Fab-user@nongnu.org
http://lists.nongnu.org/mailman/listinfo/fab-user