- Anacron isn't standard crond!
authorundefine <undefine@pld-linux.org>
Sun, 5 Nov 2000 12:52:50 +0000 (12:52 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- PID file back to anacron
- don't kill anacron if is't running

Changed files:
    anacron.init -> 1.4

anacron.init

index 4525952..79a24e9 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
                exit 1
@@ -34,12 +34,17 @@ case "$1" in
        ;;
   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
+        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 Cron
+                msg_Not_Running Anacron
                 exit 1
         fi
        ;;
This page took 0.084919 seconds and 4 git commands to generate.