]> git.pld-linux.org Git - packages/nfs-utils.git/blobdiff - nfs.init
- rel 4
[packages/nfs-utils.git] / nfs.init
index a2f9fb1a931bec84b3792e0be736e0bc5f311c47..0da6062e1f467d2d9646c2c351f8981f3c2033ae 100644 (file)
--- a/nfs.init
+++ b/nfs.init
@@ -3,7 +3,7 @@
 # nfs          This shell script takes care of starting and stopping
 #              the NFS services.
 #
-# chkconfig:   345 12 84
+# chkconfig:   345 13 81
 # description: NFS is a popular protocol for file sharing across TCP/IP \
 #              networks. This service provides NFS server functionality, \
 #              which is configured via the /etc/exports file.
@@ -34,8 +34,8 @@ 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
 
 start() {
@@ -64,10 +64,10 @@ start() {
                # Start daemons.
                msg_starting "NFS exportfs"
                daemon /usr/sbin/exportfs -r
-               msg_starting "NFS daemon"
-               daemon rpc.nfsd $RPCNFSDCOUNT
                msg_starting "NFS mountd"
                daemon rpc.mountd $RPCMOUNTOPTIONS
+               msg_starting "NFS daemon"
+               daemon rpc.nfsd $RPCNFSDCOUNT
                touch /var/lock/subsys/nfs
        else
                msg_already_running "NFS daemon"
@@ -77,10 +77,10 @@ start() {
 stop() {
        if [ -f /var/lock/subsys/nfs ]; then
                # Stop daemons.
-               msg_stopping "NFS mountd"
-               killproc rpc.mountd
                msg_stopping "NFS daemon"
                killproc nfsd -QUIT
+               msg_stopping "NFS mountd"
+               killproc rpc.mountd
                msg_stopping "NFS"
                daemon /usr/sbin/exportfs -au
                rm -f /var/lock/subsys/nfs
@@ -101,7 +101,8 @@ case "$1" in
   restart)
        stop
        start
-       /sbin/service idmapd status >/dev/null && /sbin/service idmapd restart
+       /sbin/service idmapd status >/dev/null && /sbin/service idmapd reload
+       /sbin/service svcgssd status >/dev/null && /sbin/service svcgssd restart
        ;;
   reload|force-reload)
        if [ -f /var/lock/subsys/nfs ]; then
@@ -109,8 +110,13 @@ case "$1" in
                busy
                /usr/sbin/exportfs -r
                [ $? -ne 0 ] && RETVAL=7
-               [ $RETVAL -eq 0 ] && ok || died
-               /sbin/service idmapd status >/dev/null && /sbin/service idmapd restart
+               if [ $RETVAL -eq 0 ]; then
+                       ok
+                       /sbin/service idmapd status >/dev/null && /sbin/service idmapd reload
+                       /sbin/service svcgssd status >/dev/null && /sbin/service svcgssd restart
+               else
+                       died
+               fi
        else
                msg_not_running "NFS"
                exit 7
This page took 0.066823 seconds and 4 git commands to generate.