Bug 114545

Summary: [PATCH] /etc/init.d/nfslock minor problem regarding unset NETWORKING
Product: Red Hat Enterprise Linux 3 Reporter: Peter Bieringer <pb>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Ben Levenson <benl>
Severity: low Docs Contact:
Priority: medium    
Version: 3.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-06-14 17:52:10 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:

Description Peter Bieringer 2004-01-29 13:35:22 UTC
Description of problem:
in case of NETWORKING isn't set in /etc/sysconfig/network,
/etc/init.d/nfslock has a minor problem

Version-Release number of selected component (if applicable):
nfs-utils-1.0.5-3

How reproducible:
Always

Steps to Reproduce:
1. remove NETWORKING in /etc/sysconfig/network
2. service nfslock start

Actual Results:  # service nfslock start
/etc/init.d/nfslock: line 26: [: =: unary operator expected
Starting NFS statd:                                        [  OK  ]


Expected Results:  Proper problem catching

Additional info:

Fix:

# diff -u nfslock.orig nfslock
--- nfslock.orig        2004-01-29 14:34:25.000000000 -0500
+++ nfslock     2004-01-29 14:34:33.000000000 -0500
@@ -23,7 +23,7 @@
 . /etc/sysconfig/network

 # Check that networking is up.
-[ ${NETWORKING} = "no" ] && exit 0
+[ "${NETWORKING}" = "no" ] && exit 0

 # Start lockd from userland only if kernel <= 2.2.18
 OS_RELEASE=`uname --release`


BTW: this issue rises also up on
# grep "\${NETWORKING}" /etc/init.d/* | grep -v  "\"\${NETWORKING}\""
/etc/init.d/nfs:[ ${NETWORKING} = "no" ] && exit 0
/etc/init.d/nfslock:[ ${NETWORKING} = "no" ] && exit 0
/etc/init.d/ntpd:[ ${NETWORKING} = "no" ] && exit 0
/etc/init.d/postfix:[ ${NETWORKING} = "no" ] && exit 0
/etc/init.d/spamassassin:[ ${NETWORKING} = "no" ] && exit 0
/etc/init.d/vsftpd:[ ${NETWORKING} = "no" ] && exit 0

But it is already fixed in
# grep "\${NETWORKING}" /etc/init.d/* | grep  "\"\${NETWORKING}\""
/etc/init.d/netfs:[ "${NETWORKING}" = "no" ] && exit 0
/etc/init.d/network:[ "${NETWORKING}" = "no" ] && exit 0
/etc/init.d/xinetd:[ "${NETWORKING}" = "yes" ] || exit 0

BTW: someone should think about whether "yes" or "no" would be the
proper value to check...

Comment 2 Jay Turner 2004-09-02 02:27:43 UTC
An errata has been issued which should help the problem 
described in this bug report. This report is therefore being 
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, 
please follow the link below. You may reopen this bug report 
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2004-263.html