I have a few Ubuntu 19.04 (soon to be 19.10) systems running systemd, and they all mount NAS-served mounts using systemd units. I'm also using automount units to make sure the mounts are only mounted on demand.
However, I have an interesting conundrum with Gnome Shell. After resuming from suspend, if the mounts aren't available, Gnome Shell will refuse to unlock quickly and will hang for a few minutes. It will eventually come to, but I'd just as soon do away with the delay.
Currently, both the mount units and automount are set BindsTo=networking-online.target, under the assumption that networking is taken down when suspend starts up. This assumption appears flawed.
What I'd like to have happen is have both the mount and automount units stop on suspend, and start up again on resume.
Granted: the real issue here is to figure out why Gnome is freaking out about not having some network mounts available (I haven't been able to figure out why it's doing this!! and this is frustrating!). However, since that's probably harder to fish out, I figured I'd go for a workaround first.
So...any suggestions?
Here's an example of one of the mount units:
[Unit] Description=Network Stuff Directory BindsTo=network-online.target After=network-online.target [Mount] What=//<nas-host>/Public Where=/nas/stuff Options=username=<user>,password=<password>,rw,vers=3.0,soft,noperm,_netdev,echo_interval=5 Type=cifs ForceUnmount=true TimeoutSec=5 LazyUnmount=true [Install] WantedBy=multi-user.target And here's its accompanying automount unit:
[Unit] Description=Automount Network Stuff Directory StartLimitIntervalSec=0 BindsTo=network-online.target After=network-online.target [Automount] Where=/nas/stuff [Install] WantedBy=multi-user.target Of the above units, only the automount unit is enabled (i.e. set to autostart on boot), since the mount unit is meant to be started by the automount unit.
Thanks!