- added using %%{rpmcflags} macro.
[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/lock/subsys/anacron
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/anacron ]; then
26                 msg_starting Anacron
27                 daemon anacron
28                 RETVAL=$?
29                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/anacron
30         else
31                 msg_Already_Running Anacron
32                 exit 1
33         fi
34         ;;
35   stop)
36         # Stop daemons.
37         if [ -f /var/lock/subsys/anacron ]; then
38                 msg_stopping Anacron
39                 if [ `pidofproc anacron` ]; then
40                                 # if anacron is yet running
41                                  killproc anacron;
42                                 else
43                                  ok;
44                             fi
45                 rm -f /var/lock/subsys/anacron >/dev/null 2>&1
46         else
47                 msg_Not_Running Anacron
48                 exit 1
49         fi
50         ;;
51   status)
52         status anacron
53         ;;
54   restart)
55         $0 stop
56         $0 start
57         ;;
58   *)
59         msg_Usage: "$0 {start|stop|status|restart}"
60         exit 1
61 esac
62
63 exit $RETVAL
This page took 0.049052 seconds and 3 git commands to generate.