- updated
[packages/anacron.git] / anacron.init
index 45259529a4ebf8622711527db58661a74610a71b..9ac42061a3abc7b61dc48ab06941b2ee40f12e96 100644 (file)
@@ -8,7 +8,7 @@
 #
 # processname: anacron
 # config:      /etc/anacrontab
-# pidfile:     /var/run/crond.pid
+# pidfile:     /var/lock/subsys/anacron
 
 
 # Source function library
 case "$1" in
   start)
        # Check if the service is already running?
-       if [ ! -f /var/lock/subsys/crond ]; then
+       if [ ! -f /var/lock/subsys/anacron ]; then
                msg_starting Anacron
                daemon anacron
                RETVAL=$?
-               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/crond
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/anacron
        else
-               msg_Already_Running Anacron
+               msg_already_running Anacron
                exit 1
        fi
        ;;
   stop)
-        # Stop daemons.
-        if [ -f /var/lock/subsys/crond ]; then
-                msg_stopping Cron
-                killproc anacron
-                rm -f /var/lock/subsys/crond >/dev/null 2>&1
-        else
-                msg_Not_Running Cron
-                exit 1
-        fi
+       # Stop daemons.
+       if [ -f /var/lock/subsys/anacron ]; then
+               msg_stopping Anacron
+               if [ `pidofproc anacron` ]; then
+                       # if anacron is yet running
+                       killproc anacron;
+               else
+                       ok;
+               fi
+               rm -f /var/lock/subsys/anacron >/dev/null 2>&1
+       else
+               msg_not_running Anacron
+               exit 1
+       fi
        ;;
   status)
        status anacron
        ;;
-  restart)
+  restart|reload)
        $0 stop
        $0 start
        ;;
   *)
-       msg_Usage: "$0 {start|stop|status|restart}"
+       msg_usage "$0 {start|stop|restart|reload|status}"
        exit 1
 esac
 
This page took 0.125312 seconds and 4 git commands to generate.