wok view fcron/stuff/fcron @ rev 25037

Up glza (0.11.4)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat May 21 21:38:29 2022 +0000 (2022-05-21)
parents 7f188676b59c
children
line source
1 #!/bin/sh
2 # /etc/init.d/fcron : Start, stop and restart fcron on SliTaz,
3 # at boot time or with the command line.
4 #
5 # To start fcron server at boot time, just put fcron in the RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=fcron
12 DESC="$(_ '%s daemon' Cron)"
13 DAEMON=/usr/bin/fcron
14 OPTIONS="$FCRON_OPTIONS"
15 [ -n "$FCRON_OPTIONS" ] || OPTIONS="-b"
16 PIDFILE=/var/run/fcron.pid
18 case "$1" in
19 (start)
20 if active_pidfile $PIDFILE fcron
21 then
22 _ '%s is already running.' $NAME
23 exit 1
24 fi
25 action 'Starting %s: %s...' "$DESC" $NAME
26 $DAEMON $OPTIONS
27 status
28 ;;
29 (stop)
30 if ! active_pidfile $PIDFILE fcron
31 then
32 _ '%s is not running.' $NAME
33 exit 1
34 fi
35 action 'Stopping %s: %s...' "$DESC" $NAME
36 kill $(cat $PIDFILE)
37 status
38 ;;
39 (restart)
40 if ! active_pidfile $PIDFILE fcron
41 then
42 _ '%s is not running.' $NAME
43 exit 1
44 fi
45 action 'Restarting %s: %s...' "$DESC" $NAME
46 kill $(cat $PIDFILE)
47 sleep 2
48 $DAEMON $OPTIONS
49 status
50 ;;
51 (*)
52 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
53 newline
54 exit 1
55 ;;
56 esac
58 exit 0