Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 479726 - net-fs/nfs-utils: /etc/init.d/nfsmount: use -f when unmounting
Summary: net-fs/nfs-utils: /etc/init.d/nfsmount: use -f when unmounting
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-04 14:46 UTC by Toralf Förster
Modified: 2016-01-22 08:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2013-08-04 14:46:07 UTC
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.
Comment 1 dwfreed 2013-08-05 10:30:15 UTC
(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.
Comment 2 Toralf Förster gentoo-dev 2013-08-05 17:24:27 UTC
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.
Comment 3 SpanKY gentoo-dev 2013-11-28 00:20:46 UTC
the question is whether there are bad side effects to always using -f.  if there aren't, then we can add it.
Comment 4 nobody 2014-04-12 00:23:19 UTC
At least you seems luckier than me :)
https://bugs.gentoo.org/show_bug.cgi?id=340589

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...)
Comment 5 Toralf Förster gentoo-dev 2014-04-12 08:24:00 UTC
so "-l" as default and "-f" as a occasionally config option, right ?
Comment 6 Toralf Förster gentoo-dev 2014-04-12 13:20:19 UTC
Well, so something like this in /etc/conf.d/nfsmount :

# use -l for a lazy umount and -f to become roughly
#
UMOUNT_OPTS=-f


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 <neilb@suse.de> via email)