#!/bin/bash # # init file for ClusterNFS # # chkconfig: 345 50 50 # # description: ClusterNFS server # # source function library . /etc/rc.d/init.d/functions # Get network config . /etc/sysconfig/network # Check that networking is up. if is_yes "${NETWORKING}"; then if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then msg_network_down ClusterNFS exit 1 fi else exit 0 fi OPTIONS_NFSD="-T" OPTIONS_MNTD="-T" prog_nfsd="rpc.nfsd" prog_mntd="rpc.mountd" RETVAL=0 #See how we were called. case "$1" in start) # Check if the service is already running? if [ ! -f /var/lock/subsys/clusternfs ]; then msg_starting "ClusterNFS ($prog_mntd)" daemon /usr/sbin/rpc.mountd $OPTIONS_MNTD RETVAL=$? if [ $RETVAL -eq 0 ]; then msg_starting "ClusterNFS ($prog_nfsd)" daemon /usr/sbin/rpc.nfsd $OPTIONS_NFSD RETVAL=$? fi [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clusternfs else msg_already_running ClusterNFS fi ;; stop) # Stop daemons. if [ ! -f /var/lock/subsys/clusternfs ]; then msg_stopping "ClusterNFS ($prog_nfsd)" killproc /usr/sbin/rpc.nfsd msg_stopping "ClusterNFS ($prog_mntd)" killproc /usr/sbin/rpc.mountd rm -f /var/lock/subsys/clusternfs else msg_not_running ClusterNFS fi ;; status) ;; restart|force-reload) $0 stop $0 start exit $? ;; *) msg_usage "$0 {start|stop|restart|force-reload|status}" exit 3 esac exit $RETVAL