diff options
author | Bartłomiej Piotrowski <b@bpiotrowski.pl> | 2012-06-08 10:06:07 +0200 |
---|---|---|
committer | Bartłomiej Piotrowski <b@bpiotrowski.pl> | 2012-06-08 10:45:37 +0200 |
commit | a231c6d5d91058ad3eafa634cbfe1ac5d834cdac (patch) | |
tree | 7f4525f06351f09d42acf79d480b402aedfc0733 /testing/vnstat/vnstatd.initd | |
parent | 1fa277477ab6b71b8af8d1a2808fbfc071028b37 (diff) | |
download | aports-a231c6d5d91058ad3eafa634cbfe1ac5d834cdac.tar.bz2 aports-a231c6d5d91058ad3eafa634cbfe1ac5d834cdac.tar.xz |
testing/vnstat: new aport
Diffstat (limited to 'testing/vnstat/vnstatd.initd')
-rw-r--r-- | testing/vnstat/vnstatd.initd | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/testing/vnstat/vnstatd.initd b/testing/vnstat/vnstatd.initd new file mode 100644 index 0000000000..b3f136cef3 --- /dev/null +++ b/testing/vnstat/vnstatd.initd @@ -0,0 +1,37 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/vnstat/files/vnstatd.initd,v 1.6 2012/01/01 01:19:16 idl0r Exp $ + +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 + 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 $(< "${VNSTATD_PIDFILE}") &>/dev/null + eend $? +} |