- updated
[packages/anacron.git] / anacron.init
CommitLineData
74435928 1#!/bin/sh
74435928 2#
52685606 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
9dc36dd9 11# pidfile: /var/lock/subsys/anacron
74435928 12
52685606 13
14# Source function library
74435928 15. /etc/rc.d/init.d/functions
16
52685606 17# Get service config
18[ -f /etc/sysconfig/anacron ] && . /etc/sysconfig/anacron
19
74435928 20
52685606 21# See how we were called.
74435928 22case "$1" in
23 start)
52685606 24 # Check if the service is already running?
9dc36dd9 25 if [ ! -f /var/lock/subsys/anacron ]; then
52685606 26 msg_starting Anacron
74435928 27 daemon anacron
52685606 28 RETVAL=$?
9dc36dd9 29 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/anacron
52685606 30 else
f1f15ba3 31 msg_already_running Anacron
52685606 32 exit 1
33 fi
34 ;;
74435928 35 stop)
972b495e 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
52685606 50 ;;
51 status)
52 status anacron
53 ;;
972b495e 54 restart|reload)
52685606 55 $0 stop
56 $0 start
57 ;;
74435928 58 *)
972b495e 59 msg_usage "$0 {start|stop|restart|reload|status}"
52685606 60 exit 1
74435928 61esac
62
52685606 63exit $RETVAL
This page took 0.079761 seconds and 4 git commands to generate.