| Summary: | /etc/init.d/nfs mishandles /var/lock/subsys/nfs | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Peter Staubach <plstaubach> | |
| Component: | nfs-utils | Assignee: | Steve Dickson <steved> | |
| Status: | CLOSED ERRATA | QA Contact: | yanfu,wang <yanwang> | |
| Severity: | medium | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | 6.0 | CC: | kzhang, pbenas | |
| Target Milestone: | rc | |||
| Target Release: | --- | |||
| Hardware: | All | |||
| OS: | Linux | |||
| Whiteboard: | ||||
| Fixed In Version: | nfs-utils-1.2.3-18.el6 | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 851946 (view as bug list) | Environment: | ||
| Last Closed: | 2012-06-20 15:08:29 UTC | Type: | --- | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Bug Depends On: | ||||
| Bug Blocks: | 851946 | |||
|
Description
Peter Staubach
2012-01-23 15:39:04 UTC
Here is the needed patch.
diff --git a/nfs.init b/nfs.init
index 2b84f7e..140df07 100755
--- a/nfs.init
+++ b/nfs.init
@@ -197,7 +197,7 @@ case "$1" in
;;
reload | force-reload)
/usr/sbin/exportfs -r
- touch /var/lock/subsys/nfsd
+ [ -f /var/lock/subsys/nfsd ] && touch /var/lock/subsys/nfsd
;;
probe)
if [ ! -f /var/lock/subsys/nfsd ] ; then
Reproduced on rhel6.1 package with the same result of comment #0: # rpm -qa|grep nfs-utils nfs-utils-lib-devel-1.1.5-3.el6.x86_64 nfs-utils-1.2.3-7.el6_1.1.x86_64 nfs-utils-lib-1.1.5-3.el6.x86_64 nfs-utils-debuginfo-1.2.3-7.el6_1.1.x86_64 # /etc/init.d/nfs status rpc.svcgssd is stopped rpc.mountd is stopped nfsd is stopped rpc.rquotad is stopped # /etc/init.d/nfs reload It creates the lock file anyway even though the NFS server is not running: # ls -l /var/lock/subsys/nfs -rw-r--r--. 1 root root 0 Apr 23 04:36 /var/lock/subsys/nfs # /etc/init.d/nfs probe restart # /etc/init.d/nfs condrestart Shutting down NFS mountd: [FAILED] Shutting down NFS daemon: [FAILED] Shutting down NFS quotas: [FAILED] Starting NFS services: [ OK ] Starting NFS quotas: [ OK ] Starting NFS daemon: [ OK ] Starting NFS mountd: [ OK ] # /etc/init.d/nfs condstop Shutting down NFS mountd: [ OK ] Shutting down NFS daemon: [ OK ] Shutting down NFS quotas: [ OK ] Verified on nfs-utils-1.2.3-21.el6: # rpm -qa|grep nfs-utils nfs-utils-lib-1.1.5-4.el6.i686 nfs-utils-1.2.3-21.el6.i686 # /etc/init.d/nfs stop Shutting down NFS daemon: [ OK ] Shutting down NFS mountd: [ OK ] Shutting down NFS quotas: [ OK ] [root@hp-bl260cg5-01 autofs-5.0.5]# ls -l /var/lock/subsys/nfsd ls: cannot access /var/lock/subsys/nfsd: No such file or directory # /etc/init.d/nfs reload Now it doesn't create the lock file when the NFS server is not running: # ls -l /var/lock/subsys/nfsd ls: cannot access /var/lock/subsys/nfsd: No such file or directory Now "probe", "condrestart" and "condstop" functions work correctly: # /etc/init.d/nfs condrestart # /etc/init.d/nfs condstop # /etc/init.d/nfs probe start # /etc/init.d/nfs start Starting NFS services: [ OK ] Starting NFS quotas: [ OK ] Starting NFS mountd: [ OK ] Starting NFS daemon: [ OK ] # ls -l /var/lock/subsys/nfsd -rw-r--r--. 1 root root 0 Apr 23 04:44 /var/lock/subsys/nfsd # /etc/init.d/nfs probe # echo $? 0 # /etc/init.d/nfs condrestart Shutting down NFS daemon: [ OK ] Shutting down NFS mountd: [ OK ] Shutting down NFS quotas: [ OK ] Starting NFS services: [ OK ] Starting NFS quotas: [ OK ] Starting NFS mountd: [ OK ] Starting NFS daemon: [ OK ] # /etc/init.d/nfs condstop Shutting down NFS daemon: [ OK ] Shutting down NFS mountd: [ OK ] Shutting down NFS quotas: [ OK ] # /etc/init.d/nfs status rpc.svcgssd is stopped rpc.mountd is stopped nfsd is stopped rpc.rquotad is stopped Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2012-0964.html |