2
# Start/stop the cron daemon.
6
# Required-Start: $remote_fs $syslog $time
7
# Required-Stop: $remote_fs $syslog $time
8
# Should-Start: $network $named slapd autofs ypbind nscd nslcd winbind
9
# Should-Stop: $network $named slapd autofs ypbind nscd nslcd winbind
10
# Default-Start: 2 3 4 5
12
# Short-Description: Regular background program processing daemon
13
# Description: cron is a standard UNIX program that runs user-specified
14
# programs at periodic scheduled times. vixie cron adds a
15
# number of features to the basic UNIX cron, including better
16
# security and more powerful configuration options.
19
PATH=/bin:/usr/bin:/sbin:/usr/sbin
23
PIDFILE=/var/run/crond.pid
24
SCRIPTNAME=/etc/init.d/"$NAME"
26
test -f $DAEMON || exit 0
28
. /lib/lsb/init-functions
30
[ -r /etc/default/cron ] && . /etc/default/cron
32
# Read the system's locale and set cron's locale. This is only used for
33
# setting the charset of mails generated by cron. To provide locale
34
# information to tasks running under cron, see /etc/pam.d/cron.
36
# We read /etc/environment, but warn about locale information in
37
# there because it should be in /etc/default/locale.
40
for ENV_FILE in /etc/environment /etc/default/locale; do
41
[ -r "$ENV_FILE" ] || continue
42
[ -s "$ENV_FILE" ] || continue
44
for var in LANG LANGUAGE LC_ALL LC_CTYPE; do
45
value=`egrep "^${var}=" "$ENV_FILE" | tail -n1 | cut -d= -f2`
46
[ -n "$value" ] && eval export $var=$value
48
if [ -n "$value" ] && [ "$ENV_FILE" = /etc/environment ]; then
49
log_warning_msg "/etc/environment has been deprecated for locale information; use /etc/default/locale for $var=$value instead"
54
# Get the timezone set.
55
if [ -z "$TZ" -a -e /etc/timezone ]; then
56
TZ=`cat /etc/timezone`
60
# Parse the system's environment
61
if [ "$READ_ENV" = "yes" ] ; then
67
start) log_daemon_msg "Starting periodic command scheduler" "cron"
68
start_daemon -p $PIDFILE $DAEMON $EXTRA_OPTS
71
stop) log_daemon_msg "Stopping periodic command scheduler" "cron"
72
killproc -p $PIDFILE $DAEMON
74
[ $RETVAL -eq 0 ] && [ -e "$PIDFILE" ] && rm -f $PIDFILE
77
restart) log_daemon_msg "Restarting periodic command scheduler" "cron"
81
reload|force-reload) log_daemon_msg "Reloading configuration files for periodic command scheduler" "cron"
82
# cron reloads automatically
86
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
88
*) log_action_msg "Usage: /etc/init.d/cron {start|stop|status|restart|reload|force-reload}"