wok annotate fcron/stuff/fcron @ rev 4192
Add: fcron
author | Eric Joseph-Alexandre <erjo@slitaz.org> |
---|---|
date | Wed Sep 23 14:06:30 2009 +0000 (2009-09-23) |
parents | |
children | 7f188676b59c |
rev | line source |
---|---|
erjo@4192 | 1 #!/bin/sh |
erjo@4192 | 2 # /etc/init.d/fcron : Start, stop and fcron on SliTaz, at |
erjo@4192 | 3 # boot time or with the command line. |
erjo@4192 | 4 # |
erjo@4192 | 5 # To start SSH server at boot time, just put fcron in the $RUN_DAEMONS |
erjo@4192 | 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf |
erjo@4192 | 7 # |
erjo@4192 | 8 . /etc/init.d/rc.functions |
erjo@4192 | 9 . /etc/daemons.conf |
erjo@4192 | 10 |
erjo@4192 | 11 NAME=fcron |
erjo@4192 | 12 DESC="Cron daemon" |
erjo@4192 | 13 DAEMON=/usr/bin/fcron |
erjo@4192 | 14 OPTIONS=-b |
erjo@4192 | 15 PIDFILE=/var/run/fcron.pid |
erjo@4192 | 16 |
erjo@4192 | 17 case "$1" in |
erjo@4192 | 18 start) |
erjo@4192 | 19 if active_pidfile $PIDFILE fcron ; then |
erjo@4192 | 20 echo "$NAME already running." |
erjo@4192 | 21 exit 1 |
erjo@4192 | 22 fi |
erjo@4192 | 23 echo -n "Starting $DESC: $NAME... " |
erjo@4192 | 24 $DAEMON $OPTIONS |
erjo@4192 | 25 status |
erjo@4192 | 26 ;; |
erjo@4192 | 27 stop) |
erjo@4192 | 28 if ! active_pidfile $PIDFILE fcron ; then |
erjo@4192 | 29 echo "$NAME is not running." |
erjo@4192 | 30 exit 1 |
erjo@4192 | 31 fi |
erjo@4192 | 32 echo -n "Stopping $DESC: $NAME... " |
erjo@4192 | 33 kill `cat $PIDFILE` |
erjo@4192 | 34 status |
erjo@4192 | 35 ;; |
erjo@4192 | 36 restart) |
erjo@4192 | 37 if ! active_pidfile $PIDFILE fcron ; then |
erjo@4192 | 38 echo "$NAME is not running." |
erjo@4192 | 39 exit 1 |
erjo@4192 | 40 fi |
erjo@4192 | 41 echo -n "Restarting $DESC: $NAME... " |
erjo@4192 | 42 kill `cat $PIDFILE` |
erjo@4192 | 43 sleep 2 |
erjo@4192 | 44 $DAEMON $OPTIONS |
erjo@4192 | 45 status |
erjo@4192 | 46 ;; |
erjo@4192 | 47 *) |
erjo@4192 | 48 echo "" |
erjo@4192 | 49 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" |
erjo@4192 | 50 echo "" |
erjo@4192 | 51 exit 1 |
erjo@4192 | 52 ;; |
erjo@4192 | 53 esac |
erjo@4192 | 54 |
erjo@4192 | 55 exit 0 |