]> git.pld-linux.org Git - packages/nfs-utils.git/blobdiff - rpcsvcgssd.init
- http://www.citi.umich.edu/projects/nfsv4/linux/nfs-utils-patches/1.1.1-1/nfs-utils...
[packages/nfs-utils.git] / rpcsvcgssd.init
index e3979ddc79d2166106a5a15c70eeb342f1404d49..1e16bc1088843d4390d701fab5c7a5f276697ad3 100644 (file)
@@ -1,12 +1,10 @@
-#!/bin/bash
+#!/bin/sh
 #
-# rpcsvcgssd    Start up and shut down RPCSEC GSS daemon
+# svcgssd      Start up and shut down RPCSEC GSS daemon
 #
-# Authors:     Chuck Lever <cel@netapp.com>
-#
-# chkconfig: - 14 81
-# description: Starts user-level daemon that manages RPCSEC GSS contexts \
-#             for the NFSv4 server.
+# chkconfig:   345 12 82
+# description: Starts user-level daemon that manages RPCSEC GSS contexts \
+#              for the NFSv4 server.
 
 # 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 svcgssd daemon"
+               msg_network_down "RPC svcgssd"
                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
@@ -36,23 +34,14 @@ is_yes "${SECURE_NFS}" || exit 0
 # List of kernel modules to load
 [ -z "${SECURE_NFS_MODS}" ] && SECURE_NFS_MODS="des rpcsec_gss_krb5"
 
-RETVAL=0
-
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/svcgssd ]; then
                # We need /proc/fs/nfsd mounted before starting svcgssd
                if ! grep -q nfsd /proc/mounts ; then
-                       modprobe -s nfsd > /dev/null 2>&1
+                       modprobe nfsd > /dev/null 2>&1
                        run_cmd "Mounting /proc/fs/nfsd filesystem" mount -t nfsd nfsd /proc/fs/nfsd
                fi
-               if ! grep -q rpc_pipefs /proc/mounts ; then
-                       modprobe -s 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
                # Load rpcsec modules
                for i in ${SECURE_NFS_MODS} ; do 
                        _modprobe single die $i
@@ -64,8 +53,9 @@ case "$1" in
        else
                msg_already_running "RPC svcgssd"
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/svcgssd ]; then
                msg_stopping "RPC svcgssd"
                killproc rpc.svcgssd
@@ -73,15 +63,24 @@ case "$1" in
        else
                msg_not_running "RPC svcgssd"
        fi
+}
+
+# See how we were called.
+RETVAL=0
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        status rpc.svcgssd
        RETVAL=$?
        ;;
   restart|reload)
-       $0 stop
-       $0 start
-       RETVAL=$?
+       stop
+       start
        ;;
   *)
        msg_usage "$0 {start|stop|restart|status}"
This page took 0.031413 seconds and 4 git commands to generate.