projects/aports·blob v1.7 · refs

39 lines · 707 B

1#!/sbin/runscript
2
3# Sample init.d file for alpine linux.
4
5NAME=
6DAEMON=/usr/sbin/$NAME
7
8depend() {
9 need net
10}
11
12start() {
13 ebegin "Starting ${NAME}"
14 start-stop-daemon --start --quiet --background \
15 --make-pidfile --pidfile /var/run/${NAME}.pid \
16 --chuid ${USER}:${GROUP} \
17 --exec ${DAEMON} -- ${OPTS}
18 eend $?
19}
20
21stop() {
22 ebegin "Stopping ${NAME}"
23 start-stop-daemon --stop --quiet \
24 --exec ${DAEMON} \
25 --pidfile /var/run/${NAME}.pid \
26 eend $?
27}
28
29reload() {
30 ebegin "Reloading ${NAME}"
31 if ! service_started "${NAME}" ; then
32 eend 1 "${NAME} is not started"
33 return 1
34 fi
35 start-stop-daemon --stop --oknodo --signal HUP \
36 --exec ${DAEMON} --pidfile /var/run/${NAME}.pid
37 eend $?
38}
39