# 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.
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() {
# 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"
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
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
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