rpms/nfs-utils/devel nfs-utils.spec, 1.186, 1.187 nfs.init, 1.28, 1.29 nfslock.init, 1.22, 1.23 rpcgssd.init, 1.11, 1.12 rpcidmapd.init, 1.10, 1.11 rpcsvcgssd.init, 1.9, 1.10

Steve Dickson steved at fedoraproject.org
Tue Sep 16 20:29:41 UTC 2008


Author: steved

Update of /cvs/pkgs/rpms/nfs-utils/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv32241

Modified Files:
	nfs-utils.spec nfs.init nfslock.init rpcgssd.init 
	rpcidmapd.init rpcsvcgssd.init 
Log Message:
 - Reworked init scripts so service will be able to
   stop when some of the checks fail. (bz 462508)



Index: nfs-utils.spec
===================================================================
RCS file: /cvs/pkgs/rpms/nfs-utils/devel/nfs-utils.spec,v
retrieving revision 1.186
retrieving revision 1.187
diff -u -r1.186 -r1.187
--- nfs-utils.spec	28 Aug 2008 17:31:27 -0000	1.186
+++ nfs-utils.spec	16 Sep 2008 20:29:11 -0000	1.187
@@ -2,7 +2,7 @@
 Name: nfs-utils
 URL: http://sourceforge.net/projects/nfs
 Version: 1.1.3
-Release: 4%{?dist}
+Release: 5%{?dist}
 Epoch: 1
 
 # group all 32bit related archs
@@ -265,6 +265,10 @@
 %attr(4755,root,root)   /sbin/umount.nfs4
 
 %changelog
+* Tue Sep 16 2008 Steve Dickson <steved at redhat.com> 1.1.3-5
+- Reworked init scripts so service will be able to
+  stop when some of the checks fail. (bz 462508)
+
 * Thu Aug 28 2008 Steve Dickson <steved at redhat.com> 1.1.3-4
 - Added in a number of up upstream patches (101 thru 110).
 


Index: nfs.init
===================================================================
RCS file: /cvs/pkgs/rpms/nfs-utils/devel/nfs.init,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- nfs.init	2 Jul 2008 23:35:53 -0000	1.28
+++ nfs.init	16 Sep 2008 20:29:11 -0000	1.29
@@ -14,41 +14,44 @@
 . /etc/rc.d/init.d/functions
 
 # Source networking configuration.
-if [ ! -f /etc/sysconfig/network ]; then
-    exit 6
-fi
+[ -f /etc/sysconfig/network ] &&  . /etc/sysconfig/network
 
-. /etc/sysconfig/network
+RETVAL=0
+
+# See how we were called.
+case "$1" in
+  start)
 
-# Check that networking is up.
-[ "${NETWORKING}" = "no" ] && exit 6
+	# Check that networking is up.
+	[ "${NETWORKING}" != "yes" ] && exit 6
 
-[ -x /usr/sbin/rpc.nfsd ] || exit 5
-[ -x /usr/sbin/rpc.mountd ] || exit 5
-[ -x /usr/sbin/exportfs ] || exit 5
+	[ -x /usr/sbin/rpc.nfsd ] || exit 5
+	[ -x /usr/sbin/rpc.mountd ] || exit 5
+	[ -x /usr/sbin/exportfs ] || exit 5
 
-# Don't fail if /etc/exports doesn't exist; create a bare-bones version and continue.
-[ -r /etc/exports ] || \
-    { touch /etc/exports && chmod u+rw,g+r,o+r /etc/exports ; } || \
-    { echo "/etc/exports does not exist" ; exit 0 ; }
+	# Make sure the rpc.mountd is not already running.
+	if status rpc.mountd > /dev/null ; then
+		exit 0
+	fi
 
-# Check for and source configuration file otherwise set defaults
-[ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
+	# Don't fail if /etc/exports doesn't exist; create a bare-bones 
+	# version and continue.
+	[ -r /etc/exports ] || \
+    	{ touch /etc/exports && chmod u+rw,g+r,o+r /etc/exports ; } || \
+    	{ echo "/etc/exports does not exist" ; exit 0 ; }
 
-[ -z "$MOUNTD_NFS_V2" ] && MOUNTD_NFS_V2=default
-[ -z "$MOUNTD_NFS_V3" ] && MOUNTD_NFS_V3=default
+	# Check for and source configuration file otherwise set defaults
+	[ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
 
-# Number of servers to be started by default
-[ -z "$RPCNFSDCOUNT" ] && RPCNFSDCOUNT=8
+	[ -z "$MOUNTD_NFS_V2" ] && MOUNTD_NFS_V2=default
+	[ -z "$MOUNTD_NFS_V3" ] && MOUNTD_NFS_V3=default
 
-# Remote quota server
-[ -z "$RQUOTAD" ] && RQUOTAD=`type -path rpc.rquotad`
+	# Number of servers to be started by default
+	[ -z "$RPCNFSDCOUNT" ] && RPCNFSDCOUNT=8
 
-RETVAL=0
+	# Remote quota server
+	[ -z "$RQUOTAD" ] && RQUOTAD=`type -path rpc.rquotad`
 
-# See how we were called.
-case "$1" in
-  start)
 	# Start daemons.
 	[ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd start
 


Index: nfslock.init
===================================================================
RCS file: /cvs/pkgs/rpms/nfs-utils/devel/nfslock.init,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- nfslock.init	2 Jul 2008 23:35:53 -0000	1.22
+++ nfslock.init	16 Sep 2008 20:29:11 -0000	1.23
@@ -22,17 +22,20 @@
 STATDARG=""
 [ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
 
-. /etc/sysconfig/network
-
-# Check that networking is up.
-[ "${NETWORKING}" = "no" ] && exit 6
-
-[ -x /sbin/rpc.statd ] || exit 5 
+[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network
 
 RETVAL=0
-
 start() {
-    if [ ! -f /var/lock/subsys/nfslock ]; then
+	# Check that networking is up.
+	[ "${NETWORKING}" = "no" ] && exit 6
+
+	[ -x /sbin/rpc.statd ] || exit 5 
+
+	# Make sure the rpc.statd is not already running.
+	if status rpc.statd > /dev/null ; then
+		exit 0
+	fi
+	rm -f /var/lock/subsys/nfslock
 
 	# Make sure locks are recovered
 	rm -f /var/run/sm-notify.pid
@@ -63,7 +66,6 @@
 	RETVAL=$?
 	echo
 	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/nfslock
-    fi
     return $RETVAL
 }
 


Index: rpcgssd.init
===================================================================
RCS file: /cvs/pkgs/rpms/nfs-utils/devel/rpcgssd.init,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- rpcgssd.init	2 Jul 2008 23:35:53 -0000	1.11
+++ rpcgssd.init	16 Sep 2008 20:29:11 -0000	1.12
@@ -12,23 +12,13 @@
 . /etc/init.d/functions
 
 # Source networking configuration.
-if [ ! -f /etc/sysconfig/network ]; then
-    exit 6
-fi
-. /etc/sysconfig/network
-
-# Check that networking is up.
-[ "${NETWORKING}" = "no" ] && exit 6
-
-[ ! -x /usr/sbin/rpc.gssd ] && exit 5
+[ -f /etc/sysconfig/network ]&&  . /etc/sysconfig/network
 
 # Check for and source configuration file otherwise set defaults
 [ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
-[ "${SECURE_NFS}" != "yes" ] && exit 6
-
-# List of kernel modules to load
-[ -z "${SECURE_NFS_MODS}" ] && SECURE_NFS_MODS="des rpcsec_gss_krb5"
 
+# See if we are configured to start
+[ "${SECURE_NFS}" != "yes" ] && exit 6
 
 # Try to use machine credentials by default
 RETVAL=0
@@ -37,14 +27,25 @@
 
 case "$1" in
   start|condstart)
+	# Check that networking is up.
+	[ "${NETWORKING}" != "yes" ] && exit 6
+	[ ! -x /usr/sbin/rpc.gssd ] && exit 5
+
 	# Make sure the daemon is not already running.
 	if status $prog > /dev/null ; then
 		exit 0
 	fi
-	rm -f $LOCKFILE
 
+	# During condstart need to check again to see 
+	# if we are configured to start
+	[ "${SECURE_NFS}" != "yes" ] && exit 6
+
+	rm -f $LOCKFILE
 	echo -n $"Starting RPC gssd: "
 
+	# List of kernel modules to load
+	[ -z "${SECURE_NFS_MODS}" ] && SECURE_NFS_MODS="des rpcsec_gss_krb5"
+
 	# Make sure the rpc_pipefs filesystem is available
 	[ "${RPCMTAB}" != "noload" ] && {
 		RPCMTAB=`grep -v '^#' /proc/mounts | \


Index: rpcidmapd.init
===================================================================
RCS file: /cvs/pkgs/rpms/nfs-utils/devel/rpcidmapd.init,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- rpcidmapd.init	2 Jul 2008 23:35:53 -0000	1.10
+++ rpcidmapd.init	16 Sep 2008 20:29:11 -0000	1.11
@@ -12,15 +12,7 @@
 . /etc/init.d/functions
 
 # Source networking configuration.
-if [ ! -f /etc/sysconfig/network ]; then
-    exit 6
-fi
-. /etc/sysconfig/network
-
-# Check that networking is up.
-[ "${NETWORKING}" = "no" ] && exit 6
-
-[ ! -x /usr/sbin/rpc.idmapd ] && exit 5
+[ -f /etc/sysconfig/network ] &&  . /etc/sysconfig/network
 
 # Check for and source configuration file otherwise set defaults
 [ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
@@ -31,11 +23,21 @@
 
 case "$1" in
   start|condstart)
+	# Check that networking is up.
+	[ "${NETWORKING}" != "yes" ] && exit 6
+	
+	[ ! -x /usr/sbin/rpc.idmapd ] && exit 5
+
 	# Make sure the daemon is not already running.
 	[ "$1" = "condstart" -a -n "`pidofproc $prog`" ] && {
 		killproc $prog "-SIGHUP" > /dev/null
 		exit 0
 	}
+	[ "$1" = "start" ] && {
+		if status $prog > /dev/null ; then
+			exit 0
+		fi
+	}
 	rm -f $LOCKFILE
 
 	echo -n $"Starting RPC idmapd: "
@@ -59,8 +61,6 @@
 		}
 	}
 
-	# Make sure the mount worked.
-
 	# Start daemon.
 	daemon $prog ${RPCIDMAPDARGS}
 	RETVAL=$?


Index: rpcsvcgssd.init
===================================================================
RCS file: /cvs/pkgs/rpms/nfs-utils/devel/rpcsvcgssd.init,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- rpcsvcgssd.init	2 Jul 2008 23:35:53 -0000	1.9
+++ rpcsvcgssd.init	16 Sep 2008 20:29:11 -0000	1.10
@@ -12,22 +12,13 @@
 . /etc/init.d/functions
 
 # Source networking configuration.
-if [ ! -f /etc/sysconfig/network ]; then
-    exit 6
-fi
-. /etc/sysconfig/network
-
-# Check that networking is up.
-[ "${NETWORKING}" = "no" ] && exit 6
-
-[ ! -x /usr/sbin/rpc.svcgssd ] && exit 5
+[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network
 
 # Check for and source configuration file otherwise set defaults
 [ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
-[ "${SECURE_NFS}" != "yes" ] && exit 6
 
-# List of kernel modules to load
-[ -z "${SECURE_NFS_MODS}" ] && SECURE_NFS_MODS="des rpcsec_gss_krb5"
+# See if we are configured to start 
+[ "${SECURE_NFS}" != "yes" ] && exit 6
 
 RETVAL=0
 LOCKFILE=/var/lock/subsys/rpcsvcgssd
@@ -35,6 +26,11 @@
 
 case "$1" in
   start|condstart)
+	# Check that networking is up.
+	[ "${NETWORKING}" != "yes" ] && exit 6
+	[ "${SECURE_NFS}" != "yes" ] && exit 6
+	[ ! -x /usr/sbin/rpc.svcgssd ] && exit 5
+
 	# Make sure the daemon is not already running.
 	if status $prog > /dev/null ; then
 		exit 0
@@ -42,6 +38,9 @@
 	rm -f $LOCKFILE
 
 	echo -n $"Starting RPC svcgssd: "
+	# List of kernel modules to load
+	[ -z "${SECURE_NFS_MODS}" ] && SECURE_NFS_MODS="des rpcsec_gss_krb5"
+
 
 	# Make sure the rpc_pipefs filesystem is available
 	[ "${RPCMTAB}" != "noload" ] && {




More information about the fedora-extras-commits mailing list