]> git.pld-linux.org Git - packages/quota.git/blob - rquotad.init
- updated to 4.02
[packages/quota.git] / rquotad.init
1 #!/bin/sh
2 #
3 # rquotad       This shell script takes care of starting and stopping
4 #               the RPC rquotad service.
5 #
6 # chkconfig:    345 12 82
7 # description:  rquotad is an RPC server which returns quotas for \
8 #               a user of a local filesystem which is mounted by \
9 #               a remote machine over the NFS.  It also allows \
10 #               setting  of quotas on NFS mounted filesystem
11 # probe: true
12
13 # Source function library.
14 . /etc/rc.d/init.d/functions
15
16 # Get network config
17 . /etc/sysconfig/network
18
19 # Get service config
20 [ -f /etc/sysconfig/rquotad ] && . /etc/sysconfig/rquotad
21
22 # Check that networking is up.
23 if is_yes "${NETWORKING}"; then
24         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
25                 msg_network_down "RPC rquotad"
26                 exit 1
27         fi
28 else
29         exit 0
30 fi
31
32 if [ "$1" != "stop" ]; then
33         check_portmapper || { nls "Error: portmap isn't running" && exit 0; }
34 fi
35
36 start() {
37         # Check if the service is already running?
38         if [ ! -f /var/lock/subsys/rquotad ]; then
39                 # RQUOTADOPTIONS will be removed in the future
40                 OPTIONS="$RQUOTADOPTIONS"
41                 [ -n "$RQUOTAD_PORT" ] && OPTIONS="$OPTIONS -p $RQUOTAD_PORT"
42                 is_yes "$AUTOFS" && OPTIONS="$OPTIONS --autofs"
43                 if is_yes "$REMOTE_QUOTA_SETTING"; then
44                     OPTIONS="$OPTIONS --setquota"
45                 else
46                     OPTIONS="$OPTIONS --no-setquota"
47                 fi
48                 # Start daemons.
49                 msg_starting "RPC rquotad"
50                 daemon rpc.rquotad $OPTIONS
51                 RETVAL=$?
52                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/rquotad
53         else
54                 msg_already_running "RPC rquotad"
55         fi
56 }
57
58 stop() {
59         if [ -f /var/lock/subsys/rquotad ]; then
60                 # Stop daemons.
61                 msg_stopping "RPC rquotad"
62                 killproc rpc.rquotad
63                 rm -f /var/lock/subsys/rquotad
64         else
65                 msg_not_running "RPC rquotad"
66         fi
67 }
68
69 RETVAL=0
70 # See how we were called.
71 case "$1" in
72   start)
73         start
74         ;;
75   stop)
76         stop
77         ;;
78   status)
79         status rpc.rquotad
80         exit $?
81         ;;
82   restart|force-reload)
83         stop
84         start
85         ;;
86   probe)
87         if [ ! -f /var/lock/subsys/quotad ]; then
88                 echo start; exit 0
89         fi
90         /sbin/pidof rpc.rquotad >/dev/null 2>&1
91         if [ $? = 1 ]; then
92                 echo restart; exit 0
93         fi
94         ;;
95   *)
96         msg_usage "$0 {start|stop|restart|force-reload|probe|status}"
97         exit 3
98 esac
99
100 exit $RETVAL
This page took 0.050003 seconds and 3 git commands to generate.