Just one quick suggestion of something to look for: is dpkg in the
PATH of your testuser? Even if accessed through sudo?

On Thu, Dec 17, 2009 at 8:23 PM, Jeff Forcier <j...@bitprophet.org> wrote:
> Hi Ruslan,
>
> On Thu, Dec 17, 2009 at 7:12 PM, Ruslan Spivak <ruslan.spi...@gmail.com> 
> 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
>
>
> _______________________________________________
> Fab-user mailing list
> Fab-user@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/fab-user
>


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

Reply via email to