]> git.pld-linux.org Git - packages/clusternfs.git/blob - clusternfs.init
7a5c0aeeee8eaf3622f9e4036d0eaa4774b74327
[packages/clusternfs.git] / clusternfs.init
1 #!/bin/bash
2 #
3 # init file for ClusterNFS
4 #
5 # chkconfig:    345 50 50
6 #
7 # description: ClusterNFS server
8 #
9
10 # source function library
11 . /etc/rc.d/init.d/functions
12
13 # Get network config
14 . /etc/sysconfig/network
15
16 # Check that networking is up.
17 if is_no "${NETWORKING}"; then
18         msg_network_down ClusterNFS
19         exit 1
20 fi
21
22 OPTIONS_NFSD="-T"
23 OPTIONS_MNTD="-T"
24 prog_nfsd="rpc.nfsd"
25 prog_mntd="rpc.mountd"
26
27 #See how we were called.
28 case "$1" in
29   start)
30         # Check if the service is already running?
31         if [ ! -f /var/lock/subsys/clusternfs ]; then
32                 msg_starting "ClusterNFS ($prog_mntd)"
33                 daemon /usr/sbin/rpc.mountd $OPTIONS_MNTD
34                 RETVAL=$?
35                 if [ "$RETVAL" = "0" ]; then
36                         msg_starting "ClusterNFS ($prog_nfsd)"
37                         daemon /usr/sbin/rpc.nfsd $OPTIONS_NFSD
38                         RETVAL=$?
39                 fi
40                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clusternfs
41         else
42                 msg_already_running ClusterNFS
43         fi
44         ;;
45   stop)
46         # Stop daemons.
47         if [ ! -f /var/lock/subsys/clusternfs ]; then
48                 msg_stopping "ClusterNFS ($prog_nfsd)"
49                 killproc /usr/sbin/rpc.nfsd
50                 msg_stopping "ClusterNFS ($prog_mntd)"
51                 killproc /usr/sbin/rpc.mountd
52                 rm -f /var/lock/subsys/clusternfs
53         else
54                 msg_not_running ClusterNFS
55         fi
56         ;;
57   restart|reload)
58         $0 stop
59         $0 start
60         ;;
61   *)
62         msg_usage "$0 {start|stop|restart|reload|status}"
63         exit 1
64 esac
65
66 exit $RETVAL
This page took 0.08426 seconds and 2 git commands to generate.