mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 13:27:09 +02:00
38 lines
870 B
Plaintext
38 lines
870 B
Plaintext
#!/sbin/openrc-run
|
|
# Copyright 1999-2012 Gentoo Foundation
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
extra_started_commands="reload"
|
|
|
|
depend() {
|
|
use net
|
|
}
|
|
|
|
VNSTATD_PIDFILE="${VNSTATD_PIDFILE:-/var/run/vnstatd/vnstatd.pid}"
|
|
|
|
start() {
|
|
ebegin "Starting vnstatd"
|
|
checkpath -q -d -m 755 -o vnstat:vnstat /var/run/vnstatd
|
|
checkpath -q -d -m 755 -o vnstat:vnstat /var/lib/vnstat
|
|
start-stop-daemon --start --quiet \
|
|
--pidfile "${VNSTATD_PIDFILE}" \
|
|
--user vnstat --group vnstat \
|
|
--nicelevel ${VNSTATD_NICELEVEL:-0} \
|
|
--exec /usr/sbin/vnstatd -- \
|
|
-d ${VNSTATD_EXTRAOPTS} -p ${VNSTATD_PIDFILE}
|
|
eend $?
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping vnstatd"
|
|
start-stop-daemon --stop --quiet \
|
|
--pidfile "${VNSTATD_PIDFILE}"
|
|
eend $?
|
|
}
|
|
|
|
reload() {
|
|
ebegin "Reloading vnstatd configuration"
|
|
kill -HUP $(< "${VNSTATD_PIDFILE}") &>/dev/null
|
|
eend $?
|
|
}
|