]>
Commit | Line | Data |
---|---|---|
161ebc28 | 1 | #!/bin/sh |
2 | # | |
3 | # crond Start/Stop the cron clock daemon. | |
4 | # | |
5 | # chkconfig: 2345 40 60 | |
6 | # | |
7 | # description: cron is a standard UNIX program that runs user-specified \ | |
8 | # programs at periodic scheduled times. hc-cron adds a number \ | |
9 | # of features to the basic UNIX cron, including better security \ | |
10 | # and more powerful configuration options. | |
11 | # | |
12 | # processname: crond | |
13 | # config: /etc/fcron.conf | |
14 | # pidfile: /var/run/fcron.pid | |
15 | ||
16 | ||
17 | # Source function library | |
18 | . /etc/rc.d/init.d/functions | |
19 | ||
20 | # Get service config | |
21 | [ -f /etc/sysconfig/cron ] && . /etc/sysconfig/cron | |
22 | ||
23 | RETVAL=0 | |
24 | # See how we were called. | |
25 | case "$1" in | |
26 | start) | |
27 | # Check if the service is already running? | |
28 | if [ ! -f /var/lock/subsys/crond ]; then | |
29 | msg_starting fcron | |
30 | daemon /usr/sbin/fcron -b -c /etc/fcron.conf | |
31 | RETVAL=$? | |
32 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/crond | |
33 | else | |
34 | msg_already_running fcron | |
35 | fi | |
36 | ;; | |
37 | stop) | |
38 | # Stop daemons. | |
39 | if [ -f /var/lock/subsys/crond ]; then | |
40 | msg_stopping fcron | |
41 | killproc fcron | |
42 | rm -f /var/lock/subsys/crond >/dev/null 2>&1 | |
43 | else | |
44 | msg_not_running fcron | |
45 | fi | |
46 | ||
47 | ;; | |
48 | status) | |
49 | status fcron | |
50 | exit $? | |
51 | ;; | |
52 | restart|force-reload) | |
53 | $0 stop | |
54 | $0 start | |
55 | exit $? | |
56 | ;; | |
57 | *) | |
58 | msg_usage "$0 {start|stop|restart|force-reload|status}" | |
59 | exit 3 | |
60 | esac | |
61 | ||
62 | exit $RETVAL |