]> git.pld-linux.org Git - packages/nfs-utils.git/blobdiff - rquotad.init
- LSB conformance
[packages/nfs-utils.git] / rquotad.init
index 63cb342f142974d8583377b444d2ee5daf908fe9..343a30a1099d612d8a2207648a0e58e0b84c0f13 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #
-# rquotad       This shell script takes care of starting and stopping
-#               the NFS quota service.
+# rquotad      This shell script takes care of starting and stopping
+#              the NFS quota service.
 #
 # chkconfig:   345 62 18
 # description: NFS is a popular protocol for file sharing across \
 [ -f /etc/sysconfig/rquotad ] && . /etc/sysconfig/rquotad
 
 # Check that networking is up.
-if [ "${NETWORKING}" = "no" ]; then
-       echo "WARNING: Networking is down. NFS rquotad and statd can't be run"
-       exit 1
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network ]; then
+               msg_network_down "NFS rquotad"
+               exit 1
+       fi
+else
+       exit 0
 fi
 
 if [ -x /sbin/pidof ] && [ "$1" != "stop" ]; then
@@ -31,38 +35,50 @@ fi
 # Sanity checks
 [ -x /usr/sbin/rpc.rquotad ] || exit 0
 
+
 # See how we were called.
 case "$1" in
   start)
-       # Start daemons.
-       show "Starting NFS quotas"
-       daemon rpc.rquotad
-       touch /var/lock/subsys/rquotad
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/rquotad ]; then
+               # Start daemons.
+               msg_starting "NFS quotas"
+               daemon rpc.rquotad
+               touch /var/lock/subsys/rquotad
+       else
+               msg_already_running "NFS quota daemon"
+               exit 1
+       fi
        ;;
   stop)
-       # Stop daemons.
-       show "Shutting down NFS quotas"
-       killproc rpc.rquotad
-       rm -f /var/lock/subsys/rquotad
+       if [ -f /var/lock/subsys/rquotad ]; then
+               # Stop daemons.
+               msg_stopping "NFS quotas"
+               killproc rpc.rquotad
+               rm -f /var/lock/subsys/rquotad
+       else
+               msg_not_running "NFS quota daemon"
+               exit 1
+       fi
        ;;
   status)
        status rpc.rquotad
        ;;
-  restart)
-       $0 stop
+  restart|reload)
+       $0 stop
        $0 start
        ;;
   probe)
        if [ ! -f /var/lock/subsys/quotad ] ; then
-         echo start; exit 0
+               echo start; exit 0
        fi
        /sbin/pidof rpc.rquotad >/dev/null 2>&1;
        if [ $? = 1 ] ; then
-         echo restart; exit 0
+               echo restart; exit 0
        fi
        ;;
   *)
-       echo "Usage: rquotad {start|stop|status|restart|probe}"
+       msg_usage "$0 {start|stop|restart|reload|probe|status}"
        exit 1
 esac
 
This page took 0.030313 seconds and 4 git commands to generate.