]> git.pld-linux.org Git - packages/clusternfs.git/blob - clusternfs.init
- updated
[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                 exit 1
44         fi
45         ;;
46   stop)
47         # Stop daemons.
48         if [ ! -f /var/lock/subsys/clusternfs ]; then
49                 msg_stopping "ClusterNFS ($prog_nfsd)"
50                 killproc /usr/sbin/rpc.nfsd
51                 msg_stopping "ClusterNFS ($prog_mntd)"
52                 killproc /usr/sbin/rpc.mountd
53                 rm -f /var/lock/subsys/clusternfs
54         else
55                 msg_not_running ClusterNFS
56                 exit 1
57         fi
58         ;;
59   status
60         ;;
61   restart|reload)
62         $0 stop
63         $0 start
64         ;;
65   *)
66         msg_usage "$0 {start|stop|restart|reload|status}"
67         exit 1
68 esac
69
70 exit $RETVAL
This page took 0.091509 seconds and 3 git commands to generate.