[Nix-dev] systemd + sshfs

Bjørn Forsman bjorn.forsman at gmail.com
Mon Sep 19 19:30:00 CEST 2016


One problem remains. When the network is down, the generated mount
unit (which systemd creates from parsing /etc/fstab) can easily enter
failed state after a few failed mounts. And due to automatic
dependencies, the automount unit becomes failed too. This is the
problem. Without the automount service, the sshfs mountpoint is left
all empty and a manual step is needed to fix the situation.

I think what's need is a Restart=always or something for one of those
units. The problem is that such options are not available in the
/etc/fstab interface[1].

So I'm back to the issue from the first post: how to mount sshfs using
the systemd.mount interface (which has full access to Restart= etc.
directives)?

In general: why is it so difficult to have a mountpoint that either
gives you access to the other filesystem OR returns an error? It seems
all too easy to end up in a situation where the filesystem becomes
"silently" unmounted and programs accessing the mountpoint will not
know about it (happily continuing using the now local filesystem).
Non-solutions: using mountpoint(1) or "test
mountpoint/THIS_FILE_INDICATES_NOT_MOUNTED".

Best regards,
Bjørn Forsman

[1] Systemd parses a few special options from /etc/fstab:
https://www.freedesktop.org/software/systemd/man/systemd.mount.html#fstab


More information about the nix-dev mailing list