]>
Commit | Line | Data |
---|---|---|
099644da JR |
1 | #!/bin/sh |
2 | # | |
3 | # rquotad This shell script takes care of starting and stopping | |
4 | # the NFS quota service. | |
5 | # | |
6 | # chkconfig: 345 62 18 | |
7 | # description: NFS is a popular protocol for file sharing across \ | |
8 | # TCP/IP networks. This service provides NFS file \ | |
9 | # locking functionality. | |
10 | # probe: true | |
11 | ||
12 | # Source function library. | |
13 | . /etc/rc.d/init.d/functions | |
14 | ||
15 | # Get network config | |
16 | . /etc/sysconfig/network | |
17 | ||
18 | # Get service config | |
19 | [ -f /etc/sysconfig/rquotad ] && . /etc/sysconfig/rquotad | |
20 | ||
21 | # Check that networking is up. | |
bf36188d JR |
22 | if is_no "${NETWORKING}"; then |
23 | msg_Network_Down "NFS rquotad" | |
099644da JR |
24 | exit 1 |
25 | fi | |
26 | ||
27 | if [ -x /sbin/pidof ] && [ "$1" != "stop" ]; then | |
28 | [ -z "`/sbin/pidof portmap`" ] && echo "Error: portmap isn't running" && exit 0 | |
29 | fi | |
30 | ||
31 | # Sanity checks | |
32 | [ -x /usr/sbin/rpc.rquotad ] || exit 0 | |
33 | ||
34 | # See how we were called. | |
35 | case "$1" in | |
36 | start) | |
37 | # Start daemons. | |
bf36188d | 38 | msg_starting "NFS quotas" |
099644da JR |
39 | daemon rpc.rquotad |
40 | touch /var/lock/subsys/rquotad | |
41 | ;; | |
42 | stop) | |
43 | # Stop daemons. | |
bf36188d | 44 | msg_stopping "NFS quotas" |
099644da JR |
45 | killproc rpc.rquotad |
46 | rm -f /var/lock/subsys/rquotad | |
47 | ;; | |
48 | status) | |
49 | status rpc.rquotad | |
50 | ;; | |
51 | restart) | |
52 | $0 stop | |
53 | $0 start | |
54 | ;; | |
55 | probe) | |
56 | if [ ! -f /var/lock/subsys/quotad ] ; then | |
57 | echo start; exit 0 | |
58 | fi | |
59 | /sbin/pidof rpc.rquotad >/dev/null 2>&1; | |
60 | if [ $? = 1 ] ; then | |
61 | echo restart; exit 0 | |
62 | fi | |
63 | ;; | |
64 | *) | |
bf36188d | 65 | msg_Usage "$0 {start|stop|status|restart|probe}" |
099644da JR |
66 | exit 1 |
67 | esac | |
68 | ||
69 | exit 0 |