I had trouble with my original fstab configuration:
osmc@server:/ /mnt/server fuse.sshfs allow_other 0 0
It turns out that OSMC would fail to mount this correctly after a reboot. Even though systemd is supposed to be smart enough to tell networked mountpoints from normal ones (and _netdev is supposed to force that but doesn’t work either), it doesn’t seem to wait correctly for the network before trying to mount the filesystem.
This shows that systemd correctly thinks it should start the mountpoint after network comes online:
$ systemctl show mnt-server.mount | grep network
Wants=network-online.target
After=network-online.target network.target system.slice -.mount remote-fs-pre.target
Unfortunately, it failed during the boot:
$ systemctl status mnt-server.mount
● mnt-server.mount - /mnt/server
Loaded: loaded (/etc/fstab; generated; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2019-01-29 01:43:00 EST; 6min ago
Where: /mnt/server
What: osmc@server:/
Docs: man:fstab(5)
man:systemd-fstab-generator(8)
Process: 438 ExecMount=/bin/mount osmc@server:/ /mnt/server -t fuse.sshfs -o _netdev,allow_other (code=exited, status=1/FAILURE)
jan 29 01:43:00 osmc systemd[1]: Mounting /mnt/server...
jan 29 01:43:00 osmc systemd[1]: Mounted /mnt/server.
jan 29 01:43:00 osmc systemd[1]: mnt-server.mount: Mount process exited, code=exited status=1
jan 29 01:43:00 osmc systemd[1]: mnt-server.mount: Unit entered failed state.
The network is online:
osmc@osmc:~$ systemctl status network-online.target
● network-online.target - Network is Online
Loaded: loaded (/lib/systemd/system/network-online.target; static; vendor preset: enabled)
Active: active since Tue 2019-01-29 01:43:00 EST; 7min ago
Docs: man:systemd.special(7)
http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
jan 29 01:43:00 osmc systemd[1]: Reached target Network is Online.
I suspect that the service starts too fast and the network isn’t really “primed” correctly. So I added the delay_connect option to the mount point and that solved the problem…
Update: this might be a bug inherent to systemd in stretch, which also seem to affect NFS configurations. See #860264 for an example. I’ll try to reproduce this and document and see if we can get this fixed in stretch already…