]> git.pld-linux.org Git - packages/nfs-utils.git/blobdiff - rpcgssd.init
- build toolchain cleanups from Chuck Lever's git
[packages/nfs-utils.git] / rpcgssd.init
index a87ae1a5113e6cb08bc7ed5a41dae192ffa888a4..38ae48ce5d23d863a4709a1071ed7295fafdab52 100644 (file)
@@ -1,12 +1,10 @@
-#!/bin/bash
+#!/bin/sh
 #
-# rpcgssd       Start up and shut down RPCSEC GSS daemon
+# gssd         Start up and shut down RPCSEC GSS daemon
 #
-# Authors:     Chuck Lever <cel@netapp.com>
-#
-# chkconfig: 345 14 81
-# description: Starts user-level daemon that manages RPCSEC GSS contexts \
-#             for the NFSv4 client.
+# chkconfig:   345 15 81
+# description: Starts user-level daemon that manages RPCSEC GSS contexts \
+#              for the NFSv4 client.
 
 # Source function library.
 . /etc/rc.d/init.d/functions
 # Check that networking is up.
 if is_yes "${NETWORKING}"; then
        if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
-               msg_network_down "RPC gssd daemon"
+               msg_network_down "RPC gssd"
                exit 1
        fi
 else
        exit 0
 fi
 
-if [ -x /sbin/pidof ] && [ "$1" != "stop" ]; then
-       [ -z "`/sbin/pidof portmap`" ] && nls "Error: portmap isn't running" && exit 0
+if [ "$1" != "stop" ]; then
+       check_portmapper || { nls "Error: portmap isn't running" && exit 0; }
 fi
 
 # Get service config
@@ -39,15 +37,11 @@ is_yes "${SECURE_NFS}" || exit 0
 # /usr may be on NFS, fail silently, nfsfs will start it
 [ -x /usr/sbin/rpc.gssd ] || exit 0
 
-RETVAL=0
-
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/gssd ]; then
                if ! grep -q rpc_pipefs /proc/mounts ; then
-                       modprobe -s sunrpc >/dev/null 2>&1
+                       modprobe sunrpc >/dev/null 2>&1
                        run_cmd "Mounting /var/lib/nfs/rpc_pipefs filesystem" \
                                mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
                fi
@@ -62,8 +56,9 @@ case "$1" in
        else
                msg_already_running "RPC gssd"
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/gssd ]; then
                msg_stopping "RPC gssd"
                killproc rpc.gssd
@@ -71,15 +66,24 @@ case "$1" in
        else
                msg_not_running "RPC gssd"
        fi
+}
+
+# See how we were called.
+RETVAL=0
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        status rpc.gssd
        RETVAL=$?
        ;;
   restart|reload)
-       $0 stop
-       $0 start
-       RETVAL=$?
+       stop
+       start
        ;;
   *)
        msg_usage "$0 {start|stop|restart|status}"
This page took 0.062281 seconds and 4 git commands to generate.