diff options
| author | hjl <hjl> | 1999-10-18 23:21:12 +0000 |
|---|---|---|
| committer | hjl <hjl> | 1999-10-18 23:21:12 +0000 |
| commit | 8b7ad01b14df1e7529b9ba8a1ea17df0d6004ef9 (patch) | |
| tree | 0904ef8554ed680fe3244fa618685e1fb7ea148b /etc | |
Initial revision
Diffstat (limited to 'etc')
| -rwxr-xr-x | etc/redhat/nfs.init | 102 | ||||
| -rwxr-xr-x | etc/redhat/nfslock.init | 82 |
2 files changed, 184 insertions, 0 deletions
diff --git a/etc/redhat/nfs.init b/etc/redhat/nfs.init new file mode 100755 index 0000000..6da8e0c --- /dev/null +++ b/etc/redhat/nfs.init @@ -0,0 +1,102 @@ +#!/bin/sh +# +# nfs This shell script takes care of starting and stopping +# the NFS 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 + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +if [ ! -f /etc/sysconfig/network ]; then + exit 0 +fi + +. /etc/sysconfig/network + +# Check that networking is up. +[ ${NETWORKING} = "no" ] && exit 0 + +[ -x /usr/sbin/rpc.nfsd ] || exit 0 +[ -x /usr/sbin/rpc.mountd ] || exit 0 +[ -x /usr/sbin/exportfs ] || exit 0 +[ -s /etc/exports ] || exit 0 + +# Number of servers to be started uo by default +RPCNFSDCOUNT=8 +# No NFS V3. +RPCMOUNTDOPTS="--no-nfs-version 3" + +# See how we were called. +case "$1" in + start) + # Start daemons. + action "Starting NFS services: " /usr/sbin/exportfs -r + echo -n "Starting NFS quotas: " + daemon rpc.rquotad + echo + echo -n "Starting NFS mountd: " + daemon rpc.mountd $RPCMOUNTDOPTS + echo + echo -n "Starting NFS daemon: " + daemon rpc.nfsd $RPCNFSDCOUNT + echo + touch /var/lock/subsys/nfs + ;; + stop) + # Stop daemons. + action "Shutting down NFS services: " /usr/sbin/exportfs -au + echo -n "Shutting down NFS mountd: " + killproc rpc.mountd + echo + echo -n "Shutting down NFS daemon: " + killproc nfsd + echo + echo -n "Shutting down NFS quotas: " + killproc rpc.rquotad + echo + rm -f /var/lock/subsys/nfs + ;; + status) + status rpc.mountd + status nfsd + status rpc.rquotad + ;; + restart) + echo -n "Restarting NFS services: " + echo -n "rpc.mountd " + killproc rpc.mountd + daemon rpc.mountd $RPCMOUNTDOPTS + /usr/sbin/exportfs -r + touch /var/lock/subsys/nfs + echo "done." + ;; + reload) + /usr/sbin/exportfs -r + touch /var/lock/subsys/nfs + ;; + probe) + if [ ! -f /var/lock/subsys/nfs ] ; then + echo start; exit 0 + fi + /sbin/pidof rpc.mountd >/dev/null 2>&1; MOUNTD="$?" + /sbin/pidof nfsd >/dev/null 2>&1; NFSD="$?" + if [ $MOUNTD = 1 -o $NFSD = 1 ] ; then + echo restart; exit 0 + fi + if [ /etc/exports -nt /var/lock/subsys/nfs ] ; then + echo reload; exit 0 + fi + ;; + *) + echo "Usage: nfs {start|stop|status|restart|reload}" + exit 1 +esac + +exit 0 + diff --git a/etc/redhat/nfslock.init b/etc/redhat/nfslock.init new file mode 100755 index 0000000..1442637 --- /dev/null +++ b/etc/redhat/nfslock.init @@ -0,0 +1,82 @@ +#!/bin/sh +# +# nfslock This shell script takes care of starting and stopping +# the NFS file locking service. +# +# chkconfig: 345 60 20 +# description: NFS is a popular protocol for file sharing across \ +# TCP/IP networks. This service provides NFS file \ +# locking functionality. +# probe: true + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +if [ ! -f /etc/sysconfig/network ]; then + exit 0 +fi + +. /etc/sysconfig/network + +# Check that networking is up. +[ ${NETWORKING} = "no" ] && exit 0 + +[ -x /usr/sbin/rpc.lockd ] || exit 0 +[ -x /usr/sbin/rpc.statd ] || exit 0 + +# See how we were called. +case "$1" in + start) + # Start daemons. + echo "Starting NFS file locking services: " + echo -n "Starting NFS lockd: " + daemon rpc.lockd + echo + echo -n "Starting NFS statd: " + daemon rpc.statd + echo + touch /var/lock/subsys/nfslock + ;; + stop) + # Stop daemons. + echo "Shutting down NFS file locking services: " + echo -n "Shutting down NFS lockd: " + killproc lockd + echo + echo -n "Shutting down NFS statd: " + killproc rpc.statd + echo + rm -f /var/lock/subsys/nfslock + ;; + status) + status lockd + status rpc.statd + ;; + restart) + echo -n "Restarting NFS file locking services: " + echo -n "rpc.lockd " + killproc lockd + daemon rpc.lockd + echo -n "rpc.statd " + killproc rpc.statd + daemon rpc.statd + touch /var/lock/subsys/nfslock + echo "done." + ;; + probe) + if [ ! -f /var/lock/subsys/nfslock ] ; then + echo start; exit 0 + fi + /sbin/pidof rpc.statd >/dev/null 2>&1; STATD="$?" + /sbin/pidof lockd >/dev/null 2>&1; LOCKD="$?" + if [ $STATD = 1 -o $LOCKD = 1 ] ; then + echo restart; exit 0 + fi + ;; + *) + echo "Usage: nfslock {start|stop|status|restart}" + exit 1 +esac + +exit 0 |
