Maybe look into autofs which will mount only when you choose to access the drives and then unmount on idle. Could be simpler then trying to react to network status.
post
I know autofs will work with nfs. Never used it with SMB. I’ve used it on a share of /home to specifically mount /home/user as needed (e.g., at login).
Systemd will do this. Iirc you just need to put the mount info in fstab.
I currently have systemd solution but it only manages to mount when needed.
Let's avoid systemd solutions. They'll just lock you deeper into lennart's cancer.
If you have systemd installed then using it is fine.
Genuine question: what init do you use & how would you do this? Of course it doesn't need to involve init.
Imagine using a well designed set of tools instead of parts stuck in the 90s
This should sidestep that and timeout pretty quickly: https://jshtab.github.io/guide/gvfs-autmount/
I'll have a look at this, updated OP for now
You never mentioned you were trying to mount live files or your home directory...that's an entirely different thing.
Yes, it does matter.
A shot in the dark, but try setting them up to connect to a hostname instead of an IP - maybe if the name doesn't resolve then it won't get stuck?
all 21 comments