File: cron.init

package info (click to toggle)
cron 3.0pl1-86
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 412 kB
  • ctags: 386
  • sloc: ansic: 3,652; sh: 194; makefile: 135
file content (30 lines) | stat: -rw-r--r-- 1,096 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
# Start/stop the cron daemon.

test -f /usr/sbin/cron || exit 0

#LSBNAMES='-l'  # Uncomment for LSB name support in /etc/cron.d/

case "$1" in
start)	echo -n "Starting periodic command scheduler: cron"
        start-stop-daemon --start --quiet --pidfile /var/run/crond.pid --name cron --startas /usr/sbin/cron -- $LSBNAMES
        echo "." 
	;;
stop)	echo -n "Stopping periodic command scheduler: cron"
        start-stop-daemon --stop --quiet --pidfile /var/run/crond.pid --name cron
        echo "."
        ;;
restart) echo -n "Restarting periodic command scheduler: cron"
        start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/crond.pid --name cron
        start-stop-daemon --start --quiet --pidfile /var/run/crond.pid --name cron --startas /usr/sbin/cron -- $LSBNAMES
        echo "."
        ;;
reload|force-reload) echo -n "Reloading configuration files for periodic command scheduler: cron"
	# cron reloads automatically
        echo "."
        ;;
*)	echo "Usage: /etc/init.d/cron start|stop|restart|reload|force-reload"
        exit 1 
        ;;
esac
exit 0