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@ubuntu-xenial:~/mosh$ ssh 192.168.122.24 hello
> elopio@192.168.122.24's password:
> bash: hello: command not found
> elopio@ubuntu-xenial:~/mosh$ ssh 192.168.122.24 /snap/bin/hello
> elopio@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

Attachment: signature.asc
Description: This is a digitally signed message part

-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft

Reply via email to