]> git.pld-linux.org Git - packages/clusternfs.git/blob - clusternfs.init
- raw version from Zbyniu <zbyniu@geocarbon.pl>
[packages/clusternfs.git] / clusternfs.init
1 #!/bin/bash
2 # init file for ClusterNFS
3 #
4 # chkconfig: 345 50 50
5 # description: ClusterNFS server
6 #
7 # processname: /usr/sbin/rpc.mountd
8 # processname: /usr/sbin/rpc.nfsd
9 # config: /etc/exports
10
11 # source function library
12 . /etc/rc.d/init.d/functions
13
14 OPTIONS_NFSD="-T"
15 OPTIONS_MNTD="-T"
16 RETVAL=0
17 prog_nfsd="rpc.nfsd"
18 prog_mntd="rpc.mountd"
19
20 start() {
21         msg_starting "ClusterNFS ($prog_mntd)"
22         daemon /usr/sbin/rpc.mountd $OPTIONS_MNTD
23         RETVAL=$?
24         msg_starting "ClusterNFS ($prog_nfsd)"
25         daemon /usr/sbin/rpc.nfsd $OPTIONS_NFSD
26         RETVAL=$?
27         touch /var/lock/subsys/clusternfs
28         return $RETVAL
29 }
30
31 stop() {
32         msg_stopping "ClusterNFS ($prog_nfsd)"
33         killproc /usr/sbin/rpc.nfsd
34         RETVAL=$?
35         msg_stopping "ClusterNFS ($prog_mntd)"  
36         killproc /usr/sbin/rpc.mountd
37         RETVAL=$?
38         rm -f /var/lock/subsys/clusternfs
39         return $RETVAL
40 }
41
42 reload(){
43         stop
44         start
45 }
46
47 restart(){
48         stop
49         start
50 }
51
52 condrestart(){
53     [ -e /var/lock/subsys/clusternfs ] && restart
54     return 0
55 }
56
57 case "$1" in
58   start)
59         start
60         ;;
61   stop)
62         stop
63         ;;
64   restart)
65         restart
66         ;;
67   reload)
68         reload
69         ;;
70   condrestart)
71         condrestart
72         ;;
73   status)
74         status rpc.nfsd
75         status rpc.mountd
76         RETVAL=$?
77         ;;
78   *)
79         gprintf "Usage: $0 {start|stop|status|restart|condrestart|reload}"
80         RETVAL=1
81 esac
82
83 exit $RETVAL
This page took 0.04385 seconds and 4 git commands to generate.