classic snap fails to find libraries

Oliver Grawert ogra at ubuntu.com
Tue Jan 24 09:59:16 UTC 2017


hi,
Am Montag, den 23.01.2017, 21:49 -0600 schrieb Leo Arias:
> After reading the other thread about a similar issue, I moved my
> libraries to stage-packages and that worked.
> 
> My problem now is that ssh can't call a binary from a snap, it will
> only work using the full path. Let's say I have the hello snap
> installed in 192.168.122.24. Then:
> 
> elopio at ubuntu-xenial:~/mosh$ ssh 192.168.122.24 hello
> elopio at 192.168.122.24's password:
> bash: hello: command not found
> elopio at ubuntu-xenial:~/mosh$ ssh 192.168.122.24 /snap/bin/hello
> elopio at 192.168.122.24's password:
> Hello, world!
> 
> I seem to remember that there was a bug open about this, but I can't
> find it. Anyone remembers what's the problem here?
> 
bash actually checks the calling process and will not source the env if
it is invoked by sshd or rshd as non-login shell (it checks if
the SSH_CLIENT environment variable is set and uses a different code
path internally).

the follwing works:

$ ssh 192.168.2.91 env|grep PATH
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/
games:/usr/local/games

$ ssh 192.168.2.91 bash -lc env|grep PATH
PATH=/home/ogra/bin:/home/ogra/.local/bin:/usr/local/sbin:/usr/local/bi
n:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

you could also do something like:
ssh 192.168.2.91 "source /etc/profile; hello"


i dont think we have a bug open for this and technically it is expected
behaviour (not different from any other ubuntu install), but given how
annoying it is i guess you should file one and we should find a proper
workaround or fix to ship in the image ...

ciao
	oli
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20170124/fa9c6f2d/attachment.sig>


More information about the Snapcraft mailing list