/snap/bin not on PATH for noninteractive ssh?
dank at kegel.com
Wed Jan 4 19:56:34 UTC 2017
Does /etc/profile.d/apps-bin-path.sh not fire on noninteractive logins?
$ ssh pi3 'echo $PATH'
Workaround #1: make it fire, dammit:
--- .bashrc.orig 2017-01-04 19:55:33.105726685 +0000
+++ .bashrc 2017-01-04 19:54:11.505653043 +0000
@@ -5,7 +5,9 @@
# If not running interactively, don't do anything
case $- in
- *) return;;
+ *) # Work around rsync snap PATH problem
+ . /etc/profile.d/apps-bin-path.sh
# don't put duplicate lines or lines starting with space in the history.
Workaround #2: invoke rsync with --rsync-path. Ugly.
rsync doesn't seem to be provided in ubuntu core 16. (It's in
classic, of course, but my world wants to be able to rsync
to a host, and I have not yet tried arranging to start a classic
environment automatically on boot and running an sshd.)
Creating a snap for rsync appears to be a piece of cake (yay!):
summary: fast, versatile, remote (and local) file-copying tool
rsync is a fast and versatile file-copying tool which can copy locally
and to/from a remote host. It offers many options to control its behavior,
and its remote-update protocol can minimize network traffic to make
transferring updates between machines fast and efficient.
It is widely used for backups and mirroring and as an improved copy
command for everyday use.
Built and installed fine with
sudo apt install snapcraft
sudo snap install --dangerous --devmode rsync_3.1.1_armhf.snap
But rsync to the machine still doesn't work,
since it expects rsync to be on PATH on the remote machine,
so you need one of the workarounds mentioned above.
End of story :-)
More information about the Snapcraft