Bug 596095

Summary: nfs-utils initscripts improvement
Product: Red Hat Enterprise Linux 6 Reporter: Yulia Kopkova <ykopkova>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED CURRENTRELEASE QA Contact: yanfu,wang <yanwang>
Severity: medium Docs Contact:
Priority: high    
Version: 6.0CC: bfields, dkovalsk, jlayton, rwheeler, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: nfs-utils-1.2.2-6.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-10 21:14:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 633349    
Attachments:
Description Flags
init scripts patch - only check $SECURE_NFS on start
none
patch -- remove superfluous $SECURE_NFS checks from init scripts none

Description Yulia Kopkova 2010-05-26 10:04:47 UTC
Description of problem:
According to https://fedoraproject.org/wiki/Packaging/SysVInitScript
nfs-utils init scripts need to be improved:

SERVICE:
nfs
nfslock
rpcgssd
rpcidmapd
rpcsvcgssd

1. if program is dead and /var/lock/subsys/$SERVICE file exists the correct exit status code is "2"
# service $SERVICE stop
# touch /var/lock/subsys/SERVICE
# service $SERVICE status ; echo $?

now: 3
expected: 2

2. init scripts should return code "4" if stopping service under
nonprivileged user

# service $SERVICE start
# su testuserqa -c 'service $SERVICE stop' ; echo $?
now: 1
expected: 4

3. init scripts should return code "4" if starting service under
nonprivileged user

# service $SERVICE stop
# su testuserqa -c 'service $SERVICE start' ; echo $?
now: 
rpcidmapd, rpcgssd: 0 
nfs, nfslock, rpcsvcgssd: 1
expected: 4

4. init script should return usage and exit code "2" for unknown argument:
# service $SERVICE nonexist
now: 3
expected: 2

5. try-restart action should be supported 

6. force-reload action should be supported (if it makes sence)

Comment 2 Steve Dickson 2010-05-26 14:21:10 UTC
*** Bug 596039 has been marked as a duplicate of this bug. ***

Comment 3 RHEL Program Management 2010-05-26 14:36:47 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 5 Yulia Kopkova 2010-06-01 13:11:08 UTC
If services rpcgssd and rpcsvcgssd are not configured, status action should return code "3"

# cat /etc/sysconfig/nfs
SECURE_NFS=no

# service rpcgssd status ; echo $?
6
now: 6
expected: 3

# service rpcsvcgssd status ; echo $?
6
now: 6
expected: 3

Moving to ASSIGNED

Comment 8 Steve Dickson 2010-07-13 18:54:28 UTC
Fixed in nfs-utils-1.2.2-3.el6

Comment 10 yanfu,wang 2010-07-30 10:23:52 UTC
I verified on rhel6-snapshot8 with nfs-utils-1.2.2-4.el6, test comment #5 again, still have the same problem.

Comment 12 Jeff Layton 2010-07-30 14:51:10 UTC
Created attachment 435575 [details]
init scripts patch - only check $SECURE_NFS on start

I think we may need something like this patch. It makes it only check the $SECURE_NFS var on start command.

Comment 13 Jeff Layton 2010-07-30 14:56:00 UTC
Note that patch in comment 12 is only lightly tested, but it seems to fix the problem reported in comment 5.

Comment 14 yanfu,wang 2010-08-02 04:40:46 UTC
verified on rhel6-snapshot8 with the above patch,result is good: 

# service rpcsvcgssd status ; echo $?
rpc.svcgssd is stopped
3

# service rpcgssd status ; echo $?
rpc.gssd is stopped
3

Comment 15 Jeff Layton 2010-08-02 11:18:23 UTC
Created attachment 436004 [details]
patch -- remove superfluous $SECURE_NFS checks from init scripts

Actually, it looks like we already check $SECURE_NFS in the start block of these init scripts. So we should be able to just remove those checks without adding them back.

I think we just need this patch.

Comment 20 yanfu,wang 2010-08-18 09:38:02 UTC
verified comment #14 by manual again and result is pass.
automatic jobs pass yet:
i386: http://rhts.redhat.com/cgi-bin/rhts/jobs.cgi?id=171251
x86_64: 
https://beaker.engineering.redhat.com/jobs/12708
http://rhts.redhat.com/cgi-bin/rhts/jobs.cgi?id=171254

Comment 21 releng-rhel@redhat.com 2010-11-10 21:14:21 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.