fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] err: bash: sudo: command not found


From: Jeff Forcier
Subject: Re: [Fab-user] err: bash: sudo: command not found
Date: Thu, 17 Dec 2009 20:23:25 -0500

Hi Ruslan,

On Thu, Dec 17, 2009 at 7:12 PM, Ruslan Spivak <address@hidden> wrote:

> When I add a different user to ~/.fabricrc:
> user = testuser
>
> $ fab test
> fails with
> --------------------------------------------------------------------
> ...
> [testdev] sudo: dpkg -i testpackage.deb
> [testdev] err: bash: sudo: command not found
>
> Fatal error: sudo() encountered an error (return code 127) while executing
> 'dpkg -i testpackage.deb'

First, thanks for the thorough debugging efforts, it's greatly appreciated!

I can't think of any obvious causes for this offhand given what you've
already eliminated, so here's a few more things to try/check out,
though they're long shots:

* Give the --show=debug flag, to see the exact command string Fabric
is sending down the line, in case there's something extra or incorrect
being added (this will modify the "[host] sudo:" output to include the
literal string being sent across)
* Try aping what Fabric is doing by manually issuing "ssh testdev
<full command including /bin/bash -l -c <etc>>" from a local shell, in
case it's somehow related to ssh versus local shell invocation;

It's possible that the problem is somehow with the use of .fabricrc,
whose functionality is quite simple and not poked at very often, so to
check on that angle there are two other things that can be done:

* print(env) just prior to the sudo() call, both with the working and
non-working setups, and see if there's any differences;
* remove the .fabricrc and pop a 'env.user = "testuser"' at the top of
your fabfile (i.e. at module level outside of any functions)

Let me know if any of that sheds any light.

Regards,
Jeff

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




reply via email to

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