summaryrefslogtreecommitdiffstats
path: root/testing/cherokee/cherokee.initd
blob: 6aed337b6ff7c943ccf56402fd0227e79d560aa3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/sbin/runscript

# Cherokee init.d file for alpine linux.

NAME=cherokee
DAEMON=/usr/sbin/$NAME
DAEMON_USER=${DAEMON_USER:-root}
DAEMON_GROUP=${DAEMON_GROUP:-root}

depend() {
	need net
}

start() {
	ebegin "Starting ${NAME}"
		start-stop-daemon --start --quiet \
			--pidfile /var/run/${NAME}.pid \
			--chuid ${DAEMON_USER}:${DAEMON_GROUP} \
			--exec ${DAEMON} -- ${OPTS}
	eend $?
}

stop() {
	ebegin "Stopping ${NAME}"
		start-stop-daemon --stop --quiet \
			--exec ${DAEMON} \
			--pidfile /var/run/${NAME}.pid
	eend $?
}

reload() {
	ebegin "Reloading ${NAME}"
	if ! service_started "${NAME}" ; then
		eend 1 "${NAME} is not started"
		return 1
	fi
	start-stop-daemon --stop --oknodo --signal HUP \
		--exec ${DAEMON} --pidfile /var/run/${NAME}.pid
	eend $?
}