X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=nfs.init;h=0da6062e1f467d2d9646c2c351f8981f3c2033ae;hb=fcdc7f4e2fc23cec363efcc7ce51ce50141d5e43;hp=913eca666c9cbcdb51381a15b582a080eedce240;hpb=a07fe7364b6014f3319c002fa021903ab2e39883;p=packages%2Fnfs-utils.git diff --git a/nfs.init b/nfs.init index 913eca6..0da6062 100644 --- 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 60 20 +# 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,6 +101,8 @@ case "$1" in restart) stop start + /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 @@ -108,7 +110,13 @@ case "$1" in busy /usr/sbin/exportfs -r [ $? -ne 0 ] && RETVAL=7 - [ $RETVAL -eq 0 ] && ok || died + 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