Jeff Forcier <j...@bitprophet.org> writes: > Hi Ruslan,
Hi Jeff, > > 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; Thanks a lot for pointing out --show=debug flag, a very useful one. My problem is solved now. Here is a description of what happened. Following your advice on ssh versus local shell invocation I tried the following commands: 1) logged into 'testdev' with ssh testu...@testdev and ran the same command as Fabric sent to the remote host: $ sudo -S -p 'sudo password:' /bin/bash -l -c 'dpkg -i testpackage.deb' Worked fine. 2) Then from my local host I ran: $ ssh testu...@testdev "type -a sudo" Password: bash: line 0: type: sudo: not found That was the problem and I remembered that when invoking a command on a remote host through SSH only ~/.bashrc is executed. So I checked both ~/.bash_profile and ~/.bashrc of 'testuser' and they were different - ~/.bash_profile set PATH to contain system directory which in turn contained 'sudo' binary and at the same time ~/.bashrc file was empty. So the problem was fixed by setting PATH in ~/.bashrc file. Once again thanks for your suggestions. Now I know more about Fabric and love it even more :) Ruslan -- Those who make the worst use of their time are the first to complain of its shortness -- Jean de la Bruyere _______________________________________________ Fab-user mailing list Fab-user@nongnu.org http://lists.nongnu.org/mailman/listinfo/fab-user