File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# SUMMARY = "Cron daemon for executing programs at set times"
22# HOMEPAGE = "https://github.com/cronie-crond/cronie/"
33
4- inherit : [autotools]
4+ inherit : [autotools, init ]
55
66metaEnvironment :
77 PKG_DESCRIPTION : " Cronie contains the standard UNIX daemon crond that runs
@@ -23,5 +23,10 @@ buildScript: |
2323 autotoolsBuild $1 \
2424 --prefix=/usr
2525
26+ # add init script
27+ if initIsAnySysvinit; then
28+ install -D -m 0755 $<@cronie/S48cronie.sh@> install/etc/init.d/S48cronie.sh
29+ fi
30+
2631packageScript : |
2732 autotoolsPackageTgt
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ #
3+ # Starts cronie (crond) daemon
4+ #
5+
6+ DAEMON=" crond"
7+ PIDFILE=" /var/run/$DAEMON .pid"
8+
9+ # shellcheck source=/dev/null
10+ [ -r " /etc/default/$DAEMON " ] && . " /etc/default/$DAEMON "
11+
12+ start () {
13+ printf ' Starting %s: ' " $DAEMON "
14+ # shellcheck disable=SC2086 # we need the word splitting
15+ start-stop-daemon -S -q -p " $PIDFILE " -x " /usr/sbin/$DAEMON "
16+ status=$?
17+ if [ " $status " -eq 0 ]; then
18+ echo " OK"
19+ else
20+ echo " FAIL"
21+ fi
22+ return " $status "
23+ }
24+
25+ stop () {
26+ printf ' Stopping %s: ' " $DAEMON "
27+ start-stop-daemon -K -q -p " $PIDFILE "
28+ status=$?
29+ if [ " $status " -eq 0 ]; then
30+ rm -f " $PIDFILE "
31+ echo " OK"
32+ else
33+ echo " FAIL"
34+ fi
35+ return " $status "
36+ }
37+
38+ restart () {
39+ stop
40+ sleep 1
41+ start
42+ }
43+
44+ case " $1 " in
45+ start|stop|restart)
46+ " $1 " ;;
47+ reload)
48+ # Restart, since there is no true "reload" feature.
49+ restart;;
50+ * )
51+ echo " Usage: $0 {start|stop|restart|reload}"
52+ exit 1
53+ esac
You can’t perform that action at this time.
0 commit comments