]> git.pld-linux.org Git - packages/nfs-utils.git/blame - rquotad.init
- removed keytab-path patch (krb5.keytab back in /etc as of krb5 1.7)
[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
cb71d8be 4# the RPC rquotad service.
099644da 5#
891a86c9 6# chkconfig: 345 12 82
cb71d8be
JR
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
099644da
JR
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.
22e78c3b 23if is_yes "${NETWORKING}"; then
b69cfb4d 24 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
cb71d8be 25 msg_network_down "RPC rquotad"
22e78c3b 26 exit 1
27 fi
28else
29 exit 0
099644da
JR
30fi
31
fcdc7f4e
JR
32if [ "$1" != "stop" ]; then
33 check_portmapper || { nls "Error: portmap isn't running" && exit 0; }
099644da
JR
34fi
35
2562982d 36start() {
73f8a2e1
JB
37 # Check if the service is already running?
38 if [ ! -f /var/lock/subsys/rquotad ]; then
2ef98933
JR
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
73f8a2e1 48 # Start daemons.
cb71d8be 49 msg_starting "RPC rquotad"
2ef98933 50 daemon rpc.rquotad $OPTIONS
768b24e2 51 RETVAL=$?
52 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/rquotad
73f8a2e1 53 else
cb71d8be 54 msg_already_running "RPC rquotad"
73f8a2e1 55 fi
2562982d
ER
56}
57
58stop() {
22e78c3b 59 if [ -f /var/lock/subsys/rquotad ]; then
73f8a2e1 60 # Stop daemons.
cb71d8be 61 msg_stopping "RPC rquotad"
73f8a2e1
JB
62 killproc rpc.rquotad
63 rm -f /var/lock/subsys/rquotad
64 else
cb71d8be 65 msg_not_running "RPC rquotad"
73f8a2e1 66 fi
2562982d
ER
67}
68
69RETVAL=0
70# See how we were called.
71case "$1" in
72 start)
73 start
74 ;;
75 stop)
76 stop
099644da
JR
77 ;;
78 status)
79 status rpc.rquotad
768b24e2 80 exit $?
099644da 81 ;;
768b24e2 82 restart|force-reload)
2562982d
ER
83 stop
84 start
099644da
JR
85 ;;
86 probe)
5da51246 87 if [ ! -f /var/lock/subsys/quotad ]; then
22e78c3b 88 echo start; exit 0
099644da 89 fi
2562982d 90 /sbin/pidof rpc.rquotad >/dev/null 2>&1
5da51246 91 if [ $? = 1 ]; then
22e78c3b 92 echo restart; exit 0
099644da
JR
93 fi
94 ;;
95 *)
768b24e2 96 msg_usage "$0 {start|stop|restart|force-reload|probe|status}"
97 exit 3
099644da
JR
98esac
99
768b24e2 100exit $RETVAL
This page took 0.073117 seconds and 4 git commands to generate.