Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow specification of '-H' (set HOME) to sudo #432

Closed
tobiasmcnulty opened this issue Sep 4, 2011 · 2 comments
Closed

allow specification of '-H' (set HOME) to sudo #432

tobiasmcnulty opened this issue Sep 4, 2011 · 2 comments

Comments

@tobiasmcnulty
Copy link

Without the -H flag to the sudo command, calls to pip may fail when run through sudo because HOME is still set to the SSH username, rather than the sudo username. This is required, e.g., for writing an error log in the case that a package build fails.

Either set this by default, or provide an argument to sudo() that will enable it on the remote sudo command.

@ghost ghost assigned bitprophet Sep 23, 2011
@reinout
Copy link

reinout commented Oct 24, 2011

I got bitten by this, too. Despite 'env_reset' being set in ubuntu's default sudoers file, HOME isn't being set to the user you sudo to... Before it ends up in fabric itself, there's an easy way to set the '-H' option always. Near the top of your fabfile, set this:

env['sudo_prefix'] += '-H '

@bitprophet
Copy link
Member

I'm going to fold this into #503, no point having 2x discussions on it.

@tobiasmcnulty and @reinout I have a comment over on #503 re: use of -i instead of -H, if you have any feedback for that, please leave some :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants