Comment 3 for bug 1246938

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1246938] Re: juju ssh exits with sub command returncode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2013-11-12 20:39, Curtis Hovey wrote:
> Looks like juju ssh thinks it is running a remote command, it
> always exits with the last returncode executed in the remote shell.
> This is very unexpectd.
>
> THIS IS EXPECTED $ juju ssh mongodb/0 'ls /bugus' ls: cannot
> access /bugus: No such file or directory Connection to 10.55.32.3
> closed. ERROR exit status 2
>
> THIS IS UNEXPECTED $ juju ssh mongodb/0
> ubuntu@juju-staging-machine-1:~$ ls /bogus ls: cannot access
> /bogus: No such file or directory ubuntu@juju-staging-machine-1:~$
> logout Connection to 10.55.32.3 closed. ERROR exit status 2

I'm pretty sure "juju ssh" is just triggering "ssh" under the covers.
So I think it is based on whatever your own "ssh" is doing.

Looking at the code, it just invokes:

ssh -l ubuntu -t -o "StrictHostKeyChecking no -o
"PasswordAuthentication no" $HOST

So *if* you're getting a return code from SSH I would look into your
ssh config/process/etc.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlKEbBoACgkQJdeBCYSNAAPKwQCggbEOURPFU2ofc0tPElqd/qCg
YfgAoIhLepF5MYIBa1qdtZ+4PfjxlzRz
=83TD
-----END PGP SIGNATURE-----