45259529a4ebf8622711527db58661a74610a71b
[packages/anacron.git] / anacron.init
1 #!/bin/sh
2 #
3 # anacrond              Start/Stop the cron clock daemon.
4 #
5 # chkconfig:    2345 40 60
6 #
7 # description:  Anacron a periodic command scheduler.
8 #
9 # processname:  anacron
10 # config:       /etc/anacrontab
11 # pidfile:      /var/run/crond.pid
12
13
14 # Source function library
15 . /etc/rc.d/init.d/functions
16
17 # Get service config
18 [ -f /etc/sysconfig/anacron ] && . /etc/sysconfig/anacron
19
20
21 # See how we were called.
22 case "$1" in
23   start)
24         # Check if the service is already running?
25         if [ ! -f /var/lock/subsys/crond ]; then
26                 msg_starting Anacron
27                 daemon anacron
28                 RETVAL=$?
29                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/crond
30         else
31                 msg_Already_Running Anacron
32                 exit 1
33         fi
34         ;;
35   stop)
36         # Stop daemons.
37         if [ -f /var/lock/subsys/crond ]; then
38                 msg_stopping Cron
39                 killproc anacron
40                 rm -f /var/lock/subsys/crond >/dev/null 2>&1
41         else
42                 msg_Not_Running Cron
43                 exit 1
44         fi
45         ;;
46   status)
47         status anacron
48         ;;
49   restart)
50         $0 stop
51         $0 start
52         ;;
53   *)
54         msg_Usage: "$0 {start|stop|status|restart}"
55         exit 1
56 esac
57
58 exit $RETVAL
This page took 0.036826 seconds and 3 git commands to generate.