3 # init file for ClusterNFS
7 # description: ClusterNFS server
10 # source function library
11 . /etc/rc.d/init.d/functions
14 . /etc/sysconfig/network
21 [ -f /etc/sysconfig/clusternfs ] && . /etc/sysconfig/clusternfs
23 # Check that networking is up.
24 if is_yes "${NETWORKING}"; then
25 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
26 msg_network_down ClusterNFS
33 if [ -x /sbin/pidof ] && [ "$1" != "stop" ]; then
34 [ -z "`/sbin/pidof portmap`" ] && nls "Error: portmap isn't running" && exit 0
38 [ -x /usr/sbin/rpc.nfsd ] || exit 0
39 [ -x /usr/sbin/rpc.mountd ] || exit 0
40 [ -f /etc/exports ] || exit 0
43 #See how we were called.
46 # Check if the service is already running?
47 if [ ! -f /var/lock/subsys/clusternfs ]; then
48 msg_starting "ClusterNFS mountd"
49 daemon /usr/sbin/rpc.mountd $OPTIONS_MNTD
51 if [ $RETVAL -eq 0 ]; then
52 msg_starting "ClusterNFS daemon"
53 daemon /usr/sbin/rpc.nfsd $OPTIONS_NFSD
56 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clusternfs
58 msg_already_running ClusterNFS
63 if [ -f /var/lock/subsys/clusternfs ]; then
64 msg_stopping "ClusterNFS daemon"
65 killproc /usr/sbin/rpc.nfsd
66 msg_stopping "ClusterNFS mountd"
67 killproc /usr/sbin/rpc.mountd
68 rm -f /var/lock/subsys/clusternfs
70 msg_not_running ClusterNFS
78 [ $RETVAL -eq 0 ] && RETVAL=$RET
86 msg_usage "$0 {start|stop|restart|force-reload|status}"