]> git.pld-linux.org Git - packages/nfs-utils.git/blame - rquotad.init
updated
[packages/nfs-utils.git] / rquotad.init
CommitLineData
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 22if is_no "${NETWORKING}"; then
0c170055 23 msg_network_down "NFS rquotad"
099644da
JR
24 exit 1
25fi
26
27if [ -x /sbin/pidof ] && [ "$1" != "stop" ]; then
28 [ -z "`/sbin/pidof portmap`" ] && echo "Error: portmap isn't running" && exit 0
29fi
30
31# Sanity checks
32[ -x /usr/sbin/rpc.rquotad ] || exit 0
33
34# See how we were called.
35case "$1" in
36 start)
73f8a2e1
JB
37 # Check if the service is already running?
38 if [ ! -f /var/lock/subsys/rquotad ]; then
39 # Start daemons.
40 msg_starting "NFS quotas"
41 daemon rpc.rquotad
42 touch /var/lock/subsys/rquotad
43 else
0c170055 44 msg_already_running "NFS quota daemon"
73f8a2e1
JB
45 exit 1
46 fi
099644da
JR
47 ;;
48 stop)
73f8a2e1
JB
49 if [ -f /var/lock/subsys/rquotad ]; then
50 # Stop daemons.
51 msg_stopping "NFS quotas"
52 killproc rpc.rquotad
53 rm -f /var/lock/subsys/rquotad
54 else
0c170055 55 msg_not_running "NFS quota daemon"
73f8a2e1
JB
56 exit 1
57 fi
099644da
JR
58 ;;
59 status)
60 status rpc.rquotad
61 ;;
62 restart)
63 $0 stop
64 $0 start
65 ;;
66 probe)
67 if [ ! -f /var/lock/subsys/quotad ] ; then
68 echo start; exit 0
69 fi
70 /sbin/pidof rpc.rquotad >/dev/null 2>&1;
71 if [ $? = 1 ] ; then
72 echo restart; exit 0
73 fi
74 ;;
75 *)
0c170055 76 msg_usage "$0 {start|stop|status|restart|probe}"
099644da
JR
77 exit 1
78esac
79
80exit 0
This page took 0.036811 seconds and 4 git commands to generate.