home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / etc / init.d / cron < prev    next >
Encoding:
Text File  |  2006-07-20  |  1.7 KB  |  48 lines

  1. #!/bin/sh
  2. # Start/stop the cron daemon.
  3. #
  4. ### BEGIN INIT INFO
  5. # Provides:          cron
  6. # Required-Start:    $syslog $time
  7. # Required-Stop:     $syslog $time
  8. # Default-Start:     2 3 4 5
  9. # Default-Stop:      S 0 1 6
  10. # Short-Description: Regular background program processing daemon
  11. # Description:       cron is a standard UNIX program that runs user-specified 
  12. #                    programs at periodic scheduled times. vixie cron adds a 
  13. #                    number of features to the basic UNIX cron, including better
  14. #                    security and more powerful configuration options.
  15.  
  16. ### END INIT INFO
  17.  
  18.  
  19. test -f /usr/sbin/cron || exit 0
  20.  
  21. #LSBNAMES='-l'  # Uncomment for LSB name support in /etc/cron.d/
  22.  
  23. . /lib/lsb/init-functions
  24.  
  25. case "$1" in
  26. start)    log_begin_msg "Starting periodic command scheduler..."
  27.         start-stop-daemon --start --quiet --pidfile /var/run/crond.pid --name cron --startas /usr/sbin/cron -- $LSBNAMES
  28.         log_end_msg $?
  29.     ;;
  30. stop)    log_begin_msg "Stopping periodic command scheduler..."
  31.         start-stop-daemon --stop --quiet --pidfile /var/run/crond.pid --name cron
  32.         log_end_msg $?
  33.         ;;
  34. restart) log_begin_msg "Restarting periodic command scheduler..."
  35.         start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/crond.pid --name cron
  36.         start-stop-daemon --start --quiet --pidfile /var/run/crond.pid --name cron --startas /usr/sbin/cron -- $LSBNAMES
  37.         log_end_msg $?
  38.         ;;
  39. reload|force-reload) log_begin_msg "Reloading configuration files for periodic command scheduler..."
  40.     # cron reloads automatically
  41.         log_end_msg 0
  42.         ;;
  43. *)    log_success_msg "Usage: /etc/init.d/cron {start|stop|restart|reload|force-reload}"
  44.         exit 1 
  45.         ;;
  46. esac
  47. exit 0
  48.