From: | "Peter Volkov (pva)" <pva@g.o> |
---|---|
To: | gentoo-commits@l.g.o |
Subject: | [gentoo-commits] gentoo-x86 commit in net-analyzer/vnstat/files: vnstatd.confd vnstatd.initd |
Date: | Sun, 21 Jun 2009 16:57:57 |
Message-Id: | E1MIQMc-0004e4-V9@stork.gentoo.org |
1 | pva 09/06/21 16:57:54 |
2 | |
3 | Added: vnstatd.confd vnstatd.initd |
4 | Log: |
5 | Added vnstatd as alternative way to update traffic database, bug #274779, thank Gordon Malm for this contribution. |
6 | (Portage version: 2.2_rc33/cvs/Linux i686) |
7 | |
8 | Revision Changes Path |
9 | 1.1 net-analyzer/vnstat/files/vnstatd.confd |
10 | |
11 | file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/vnstat/files/vnstatd.confd?rev=1.1&view=markup |
12 | plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/vnstat/files/vnstatd.confd?rev=1.1&content-type=text/plain |
13 | |
14 | Index: vnstatd.confd |
15 | =================================================================== |
16 | # /etc/conf.d/vnstatd: config file for /etc/init.d/vnstatd |
17 | |
18 | # Adjust scheduling priority on vnstatd (default: 0) |
19 | #VNSTATD_NICELEVEL="0" |
20 | |
21 | # Pass extra options to vnstatd |
22 | #VNSTATD_EXTRAOPTS="--config /etc/vnstat.conf" |
23 | |
24 | |
25 | |
26 | 1.1 net-analyzer/vnstat/files/vnstatd.initd |
27 | |
28 | file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/vnstat/files/vnstatd.initd?rev=1.1&view=markup |
29 | plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/vnstat/files/vnstatd.initd?rev=1.1&content-type=text/plain |
30 | |
31 | Index: vnstatd.initd |
32 | =================================================================== |
33 | #!/sbin/runscript |
34 | # Copyright 2009 Gentoo Foundation |
35 | # Distributed under the terms of the GNU General Public License v2 |
36 | # $Header: /var/cvsroot/gentoo-x86/net-analyzer/vnstat/files/vnstatd.initd,v 1.1 2009/06/21 16:57:54 pva Exp $ |
37 | |
38 | opts="reload" |
39 | |
40 | depend() { |
41 | use net |
42 | } |
43 | |
44 | VNSTATD_PIDFILE="${VNSTATD_PIDFILE:-/var/run/vnstatd/vnstatd.pid}" |
45 | |
46 | start() { |
47 | ebegin "Starting vnstatd" |
48 | start-stop-daemon --start --quiet \ |
49 | --pidfile "${VNSTATD_PIDFILE}" \ |
50 | --chuid vnstat:vnstat \ |
51 | --nicelevel ${VNSTATD_NICELEVEL:-0} \ |
52 | --exec /usr/bin/vnstatd -- \ |
53 | -d ${VNSTATD_EXTRAOPTS} -p ${VNSTATD_PIDFILE} |
54 | eend $? |
55 | } |
56 | |
57 | stop() { |
58 | ebegin "Stopping vnstatd" |
59 | start-stop-daemon --stop --quiet \ |
60 | --pidfile "${VNSTATD_PIDFILE}" |
61 | eend $? |
62 | } |
63 | |
64 | reload() { |
65 | if [ ! -f ${VNSTATD_PIDFILE} ]; then |
66 | eerror "Cannot reload configuration, vnstatd is not running" |
67 | eend 1 |
68 | return 1 |
69 | fi |
70 | |
71 | ebegin "Reloading vnstatd configuration" |
72 | kill -HUP $(< "${VNSTATD_PIDFILE}") &>/dev/null |
73 | eend $? |
74 | } |