summaryrefslogtreecommitdiff
path: root/net-libs/tox/files/initd
blob: c500e9b46a8e7c2e1f96cc9d0da23aa04706d07c (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
#!/sbin/runscript

PIDDIR=/run/tox-bootstrapd
PIDFILE="${PIDDIR}"/tox-bootstrap.pid

depend() {
	need net
}

start() {
	ebegin "Starting tox-dht-bootstrap daemon"

	[ -d "${PIDDIR}" ] || mkdir -p "${PIDDIR}"
	chown -R ${TOX_USER}:${TOX_GROUP} "${PIDDIR}"

	start-stop-daemon --start \
		--pidfile "${PIDFILE}" \
		--user=${TOX_USER} --group=${TOX_GROUP} \
		--exec /usr/bin/tox-bootstrapd -- /etc/tox-bootstrapd.conf

	eend $?
}

stop() {
	ebegin "Stopping tox-dht-bootstrap daemon"

	start-stop-daemon --stop \
		--pidfile "${PIDFILE}"

	eend $?
}