summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/vnstat/files/vnstatd.initd-r1')
-rw-r--r--net-analyzer/vnstat/files/vnstatd.initd-r138
1 files changed, 38 insertions, 0 deletions
diff --git a/net-analyzer/vnstat/files/vnstatd.initd-r1 b/net-analyzer/vnstat/files/vnstatd.initd-r1
new file mode 100644
index 000000000000..51e8183b26cd
--- /dev/null
+++ b/net-analyzer/vnstat/files/vnstatd.initd-r1
@@ -0,0 +1,38 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_started_commands="reload"
+
+depend() {
+ use net
+}
+
+VNSTATD_PIDFILE="${VNSTATD_PIDFILE:-/run/vnstatd/vnstatd.pid}"
+
+start() {
+ ebegin "Starting vnstatd"
+ checkpath -q -d -m 755 -o vnstat:vnstat /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/bin/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 $(cat "${VNSTATD_PIDFILE}") 2>&1 >/dev/null
+ eend $?
+}