That script won't return if the NSF server is not available.
In case of (NFS) test environments this it is often the case.
It would be good to pass "-f" to umount either via a configuration value or via a new "zap" function in the init.d script itself.
(In reply to Toralf Förster from comment #0)
> That script won't return if the NSF server is not available.
> In case of (NFS) test environments this it is often the case.
> It would be good to pass "-f" to umount either via a configuration value or
> via a new "zap" function in the init.d script itself.
You can't use zap, as zap is special to OpenRC, and tells OpenRC to reset the state for that initscript back to stopped, which is useful if the application crashed or was killed outside of OpenRC and needs to be started again.
All the stop portion of the script does is `umount -a -t nfs,nfs4` so if you know your NFS server isn't responding, you can run it yourself and then zap the script to reset the state OpenRC thinks it's in. If this is during system shutdown, this happens late enough in the process that an unclean shutdown is usually safe. Alternately, you can use the sysrq keys if available to REISUB. In the end, if you know your NFS server is hosed/hanging, you can just force the unmount yourself.
Well, the back ground is that I'm trying to bisect an NFS issue - so I really do expect that nfsmount fails.
I just had coded "-f" into th init.d script but I was just curious if it would make sense to have something in /etc/conf.d/nfsmount instead.
the question is whether there are bad side effects to always using -f. if there aren't, then we can add it.
At least you seems luckier than me :)
I would prefer the "l" option to unmount, f is rough as it don't care if the nfs is in use or not, while l do.
so with f a busy nfs will get umount, while l will umount a non busy one.
The two are the same when the nfs is dead, as f or l the nfs isn't busy anymore. But f lack safety if the nfs is in use. (This shouldn't be a problem when shutdown the computer, but this could really be one if someone /etc/init.d/nfsmount restart as the filesystem might still be in use... copying file...)
so "-l" as default and "-f" as a occasionally config option, right ?
Well, so something like this in /etc/conf.d/nfsmount :
# use -l for a lazy umount and -f to become roughly
and then using the variable here in /etc/init.d/nfsmount:
umount -a $UMOUNT_OPTS -t nfs,nfs4
(BTW "nfs4" is deprecated as I was told by Neil Brown <firstname.lastname@example.org> via email)