# 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.
RPCMOUNTOPTIONS="$RPCMOUNTOPTIONS --no-nfs-version $vers"
done
+ [ -n "$MOUNTD_PORT" ] && RPCMOUNTOPTIONS="$RPCMOUNTOPTIONS -p $MOUNTD_PORT"
+
# 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 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
+ 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