]> git.pld-linux.org Git - packages/nfs-utils.git/blame - rquotad.init
- added REMOTE_QUOTA_SETTING option
[packages/nfs-utils.git] / rquotad.init
CommitLineData
099644da
JR
1#!/bin/sh
2#
22e78c3b 3# rquotad This shell script takes care of starting and stopping
4# the NFS quota service.
099644da
JR
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.
22e78c3b 22if is_yes "${NETWORKING}"; then
b69cfb4d 23 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
22e78c3b 24 msg_network_down "NFS rquotad"
25 exit 1
26 fi
27else
28 exit 0
099644da
JR
29fi
30
31if [ -x /sbin/pidof ] && [ "$1" != "stop" ]; then
32 [ -z "`/sbin/pidof portmap`" ] && echo "Error: portmap isn't running" && exit 0
33fi
34
35# Sanity checks
36[ -x /usr/sbin/rpc.rquotad ] || exit 0
37
4d86a075 38if is_yes "$REMOTE_QUOTA_SETTING"; then
39 RQUOTADOPTIONS="$RQUOTADOPTIONS --setquota"
40else
41 RQUOTADOPTIONS="$RQUOTADOPTIONS --no-setquota"
42fi
43
768b24e2 44RETVAL=0
099644da
JR
45# See how we were called.
46case "$1" in
47 start)
73f8a2e1
JB
48 # Check if the service is already running?
49 if [ ! -f /var/lock/subsys/rquotad ]; then
50 # Start daemons.
51 msg_starting "NFS quotas"
4d86a075 52 daemon rpc.rquotad $RQUOTADOPTIONS
768b24e2 53 RETVAL=$?
54 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/rquotad
73f8a2e1 55 else
0c170055 56 msg_already_running "NFS quota daemon"
73f8a2e1 57 fi
099644da
JR
58 ;;
59 stop)
22e78c3b 60 if [ -f /var/lock/subsys/rquotad ]; then
73f8a2e1
JB
61 # Stop daemons.
62 msg_stopping "NFS quotas"
63 killproc rpc.rquotad
64 rm -f /var/lock/subsys/rquotad
65 else
0c170055 66 msg_not_running "NFS quota daemon"
73f8a2e1 67 fi
099644da
JR
68 ;;
69 status)
70 status rpc.rquotad
768b24e2 71 exit $?
099644da 72 ;;
768b24e2 73 restart|force-reload)
22e78c3b 74 $0 stop
099644da 75 $0 start
768b24e2 76 exit $?
099644da
JR
77 ;;
78 probe)
5da51246 79 if [ ! -f /var/lock/subsys/quotad ]; then
22e78c3b 80 echo start; exit 0
099644da
JR
81 fi
82 /sbin/pidof rpc.rquotad >/dev/null 2>&1;
5da51246 83 if [ $? = 1 ]; then
22e78c3b 84 echo restart; exit 0
099644da
JR
85 fi
86 ;;
87 *)
768b24e2 88 msg_usage "$0 {start|stop|restart|force-reload|probe|status}"
89 exit 3
099644da
JR
90esac
91
768b24e2 92exit $RETVAL
This page took 0.095477 seconds and 4 git commands to generate.