aboutsummaryrefslogtreecommitdiffstats
path: root/community/vnstat/vnstatd.initd
blob: 6d8c89a0226aaa99ff03ccef3bd422d4938f3917 (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
#!/sbin/openrc-run
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
supervisor=supervise-daemon

name=vnstat
description="Daemon based database updating for vnStat"

command=/usr/sbin/vnstatd
command_args="$VNSTATD_EXTRAOPTS"
command_args_foreground="--nodaemon"

command_user=vnstat:vnstat
supervise_daemon_args="--nicelevel  ${VNSTATD_NICELEVEL:-0}"

extra_started_commands="reload"

depend() {
	use net
}

pre_start() {
	checkpath -q -d -m 755 -o $command_user /var/lib/vnstat
}

reload() {
	ebegin "Reloading vnstatd configuration"
	$supervisor $RC_SVCNAME --signal HUP
	eend $?
}