#!/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_no "${NETWORKING}"; then msg_network_down ClusterNFS exit 1 fi OPTIONS_NFSD="-T" OPTIONS_MNTD="-T" prog_nfsd="rpc.nfsd" prog_mntd="rpc.mountd" #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" = "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 exit 1 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 exit 1 fi ;; status ;; restart|reload) $0 stop $0 start ;; *) msg_usage "$0 {start|stop|restart|reload|status}" exit 1 esac exit $RETVAL