#!/bin/sh # # nfs4 This shell script takes care of starting and stopping # the NFS4 services. # # chkconfig: - 60 20 # 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. # probe: true [ -x /usr/sbin/exportfs4 ] || exit 0 [ -x /usr/sbin/gssd ] || exit 0 [ -s /etc/exports ] || exit 0 # See how we were called. case "$1" in start) # Loads the modules. insmod cryptoapi insmod sunrpc insmod auth_rpcgss insmod nfs4 insmod nfsd4 # Start gssd #action "Starting GSSD: " /usr/sbin/gssd /usr/sbin/gssd & # Start daemons. echo "Starting NFS services: " /usr/sbin/exportfs4 #echo echo ;; stop) # Stop daemons. echo -n "Shutting down NFS daemon: " killall -9 nfsd4 killall -9 nfs4_laundromat echo echo -n "Shutting down gssd: " killall -9 gssd echo rmmod nfsd4 rmmod nfs4 rmmod auth_rpcgss rmmod sunrpc ;; restart) $0 stop $0 start ;; *) echo "Usage: nfs {start|stop|restart}" exit 1 esac exit 0