diff options
Diffstat (limited to 'net-analyzer/vnstat/files/vnstatd.initd-r2')
-rw-r--r-- | net-analyzer/vnstat/files/vnstatd.initd-r2 | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/net-analyzer/vnstat/files/vnstatd.initd-r2 b/net-analyzer/vnstat/files/vnstatd.initd-r2 new file mode 100644 index 000000000000..2b4a9336c2a5 --- /dev/null +++ b/net-analyzer/vnstat/files/vnstatd.initd-r2 @@ -0,0 +1,29 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_started_commands="reload" + +VNSTATD_CONFIGFILE=${VNSTATD_CONFIGFILE:-"/etc/vnstat.conf"} +VNSTATD_PIDFILE=${VNSTATD_PIDFILE:-"/run/vnstat/vnstatd.pid"} + +pidfile="${VNSTATD_PIDFILE}" +command="/usr/bin/vnstatd" +command_args="${VNSTATD_OPTS} --daemon --config \"${VNSTATD_CONFIGFILE}\" --pidfile \"${pidfile}\"" +start_stop_daemon_args="--wait ${SSD_STARTWAIT:-500}" +name="vnStat daemon" + +description="vnstatd updates vnStat databases." +description_reload="Reload ${name}'s configuration" + +required_files="${VNSTATD_CONFIGFILE}" + +start_pre() { + checkpath --directory --mode 0775 --owner vnstat:vnstat $(dirname "${pidfile}") +} + +reload() { + ebegin "Reloading ${name} configuration" + start-stop-daemon --signal HUP --pidfile "${pidfile}" + eend $? +} |