]> git.pld-linux.org Git - packages/nfs-utils.git/blame - rquotad.init
- LSB conformance
[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
23 if [ ! -f /var/lock/subsys/network ]; then
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
22e78c3b 38
099644da
JR
39# See how we were called.
40case "$1" in
41 start)
73f8a2e1
JB
42 # Check if the service is already running?
43 if [ ! -f /var/lock/subsys/rquotad ]; then
44 # Start daemons.
45 msg_starting "NFS quotas"
46 daemon rpc.rquotad
47 touch /var/lock/subsys/rquotad
48 else
0c170055 49 msg_already_running "NFS quota daemon"
73f8a2e1
JB
50 exit 1
51 fi
099644da
JR
52 ;;
53 stop)
22e78c3b 54 if [ -f /var/lock/subsys/rquotad ]; then
73f8a2e1
JB
55 # Stop daemons.
56 msg_stopping "NFS quotas"
57 killproc rpc.rquotad
58 rm -f /var/lock/subsys/rquotad
59 else
0c170055 60 msg_not_running "NFS quota daemon"
73f8a2e1
JB
61 exit 1
62 fi
099644da
JR
63 ;;
64 status)
65 status rpc.rquotad
66 ;;
22e78c3b 67 restart|reload)
68 $0 stop
099644da
JR
69 $0 start
70 ;;
71 probe)
72 if [ ! -f /var/lock/subsys/quotad ] ; then
22e78c3b 73 echo start; exit 0
099644da
JR
74 fi
75 /sbin/pidof rpc.rquotad >/dev/null 2>&1;
76 if [ $? = 1 ] ; then
22e78c3b 77 echo restart; exit 0
099644da
JR
78 fi
79 ;;
80 *)
22e78c3b 81 msg_usage "$0 {start|stop|restart|reload|probe|status}"
099644da
JR
82 exit 1
83esac
84
85exit 0
This page took 0.033732 seconds and 4 git commands to generate.