In earlier post, you mentioned that the end goal of this is to
Not waste network bandwidth while not accessing the network filesystem.
If the share is not used, then no network activity is done, at least not noticeable one.
Why would you want to kill it then ? Do you suspect it might be used unintentionally ?
an earlier version, instead of on demand the script would regularly ping the server to unmount the share if server is down. for 12 hours, it would use approx 8MB of bandwidth.
As for issue when doing shutdown, reboots and hanging.. what does the console say or journal ? Does the operating system eventually shutdowns/reboot or this is forever ?
i dont know enough about logs or debugging. it hangs forever, needed hard reboot/shutdown.
It would also be good to know exact operating system and version on your laptop as well as NFS server in question (type, OS etc.)
client - clearlinux, server -opensuse
You should using soft mounts with desired timeo, retrans options (see man or guides online to calculate). Other then those, i would give netdev option a shot. Consider playing with those options to see reduction in reboot/shutdown times while using systemd automount feature for mount.
i have indeed, maybe not extensively. my other thread for reference: Get nfs client to ignore server when server is offline - #16 by lak
I see this as reinventing the wheel and using brute force to do regular operation on operating system.
no sh yes indeed, sherlock.
that is why i prefaced by saying the script is cumbersome and the simplest solution, autofs, is broken/unmaintained in clearlinux. as i have learnt from the past while, it is not trivial or regular matter trying to replace autofs. i have not found one success story on google.
i will investigate some more nfs mount options to be used with systemd mount/automount.