]> git.pld-linux.org Git - packages/clusternfs.git/blob - clusternfs.init
- URL fixes and other cosmetics
[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_yes "${NETWORKING}"; then
18         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
19                 msg_network_down ClusterNFS
20                 exit 1
21         fi
22 else
23         exit 0
24 fi
25
26 OPTIONS_NFSD="-T"
27 OPTIONS_MNTD="-T"
28 prog_nfsd="rpc.nfsd"
29 prog_mntd="rpc.mountd"
30
31 RETVAL=0
32 #See how we were called.
33 case "$1" in
34   start)
35         # Check if the service is already running?
36         if [ ! -f /var/lock/subsys/clusternfs ]; then
37                 msg_starting "ClusterNFS ($prog_mntd)"
38                 daemon /usr/sbin/rpc.mountd $OPTIONS_MNTD
39                 RETVAL=$?
40                 if [ $RETVAL -eq 0 ]; then
41                         msg_starting "ClusterNFS ($prog_nfsd)"
42                         daemon /usr/sbin/rpc.nfsd $OPTIONS_NFSD
43                         RETVAL=$?
44                 fi
45                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clusternfs
46         else
47                 msg_already_running ClusterNFS
48         fi
49         ;;
50   stop)
51         # Stop daemons.
52         if [ ! -f /var/lock/subsys/clusternfs ]; then
53                 msg_stopping "ClusterNFS ($prog_nfsd)"
54                 killproc /usr/sbin/rpc.nfsd
55                 msg_stopping "ClusterNFS ($prog_mntd)"
56                 killproc /usr/sbin/rpc.mountd
57                 rm -f /var/lock/subsys/clusternfs
58         else
59                 msg_not_running ClusterNFS
60         fi
61         ;;
62   status)
63         ;;
64   restart|force-reload)
65         $0 stop
66         $0 start
67         exit $?
68         ;;
69   *)
70         msg_usage "$0 {start|stop|restart|force-reload|status}"
71         exit 3
72 esac
73
74 exit $RETVAL
This page took 0.055584 seconds and 3 git commands to generate.