|
From: Serge L. <sma...@us...> - 2005-10-02 23:22:44
|
Update of /cvsroot/devil-linux/build/scripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30586/scripts/scripts Added Files: Tag: rel-1-2-patches nfsd Log Message: added "||exit 1" condition to ucarp added kernel nfsd v3 --- NEW FILE: nfsd --- #!/bin/sh # # Based on sysklogd script from LFS-3.1 and earlier. # Rewritten by Gerard Beekmans - ge...@li... #$LastChangedBy: Serge Leschinsky $ #$Date: 2005/10/02 11:25:28 $ # settings source /etc/sysconfig/config # parameters NAME="NFS Server" CONFIGNAME=NFSD # settings source /etc/sysconfig/config # source function library source /etc/init.d/functions # parameters source /etc/sysconfig/nfs-server eval START=\$START_$CONFIGNAME # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} # Force execution if not called by a runlevel directory. test $link = $base && START=yes test "$START" = "yes" || exit 0 case "$1" in start) echo -n "Starting NFS mountd..." loadproc /usr/sbin/rpc.mountd echo -n "Starting NFS nfsd..." loadproc /usr/sbin/rpc.nfsd -p $PORT $PROCESSES echo -n "Starting NFS statd..." loadproc /usr/sbin/rpc.statd if [ "$QUOTAS" == "yes" ]; then echo "Starting NFS rquotad..." loadproc /usr/sbin/rpc.rquotad fi # NFSD support only in 2.6 kernel /bin/uname -r | /bin/grep "2.6" 2>&1 > /dev/null if [ $? == 0 ]; then echo -n "Mounting nfsd virtual filesystem..." /bin/mount -t nfsd none /proc/fs/nfsd 2>&1 > /dev/null evaluate_retval fi # Make ceratin that the list is refreshed on # a restart. echo -n "Exporting NFS Filesystems..." /usr/sbin/exportfs -ra 2>&1 > /dev/null evaluate_retval ;; stop) echo -n "Stopping NFS statd..." killproc /usr/sbin/rpc.statd echo -n "Stopping NFS nfsd..." # nfsd needs HUP.... ## Special case for nfsd with no full path killproc nfsd -HUP echo -n "Stopping NFS mountd..." killproc /usr/sbin/rpc.mountd if [ "$QUOTAS" == "yes" ]; then echo -n "Stopping NFS rquotad..." killproc /usr/sbin/rpc.rquotad fi echo -n "Refreshing NFS Exported Filesystems..." /usr/sbin/exportfs -au 2>&1 > /dev/null evaluate_retval # NFSD support only in 2.6 kernel /bin/uname -r | /bin/grep "2.6" 2>&1 > /dev/null if [ $? == 0 ]; then echo -n "Unmounting NFS Virtual Filesystem..." /bin/umount /proc/fs/nfsd 2>&1 > /dev/null evaluate_retval fi ;; reload) echo -n "Reloading NFS Server..." /usr/sbin/exportfs -ra evaluate_retval ;; restart) $0 stop sleep 1 $0 start ;; status) statusproc /usr/sbin/rpc.mountd ## Special case for nfsd with no full path statusproc nfsd statusproc /usr/sbin/rpc.statd if [ "$QUOTA" == "yes" ]; then statusproc rpc.rquotad fi ;; *) echo "Usage: $0 {start|stop|reload|restart|status}" exit 1 ;; esac |