Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 384266 Details for
Bug 522226
net-analyzer/vnstat - improved runscript, systemd support
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
New improved ebuild
vnstat-1.12-r1.patch (text/plain), 6.51 KB, created by
Thomas Deutschmann (RETIRED)
on 2014-09-05 20:41:56 UTC
(
hide
)
Description:
New improved ebuild
Filename:
MIME Type:
Creator:
Thomas Deutschmann (RETIRED)
Created:
2014-09-05 20:41:56 UTC
Size:
6.51 KB
patch
obsolete
>diff -rupN old/net-analyzer/vnstat/files/vnstatd-r1.confd new/net-analyzer/vnstat/files/vnstatd-r1.confd >--- old/net-analyzer/vnstat/files/vnstatd-r1.confd 1970-01-01 01:00:00.000000000 +0100 >+++ new/net-analyzer/vnstat/files/vnstatd-r1.confd 2014-09-05 20:24:49.000000000 +0200 >@@ -0,0 +1,18 @@ >+# /etc/conf.d/vnstatd: config file for /etc/init.d/vnstatd >+ >+# Configuration file >+VNSTATD_CONFIGFILE="/etc/vnstat.conf" >+ >+# PID file >+VNSTATD_PIDFILE="/run/vnstat/vnstatd.pid" >+ >+# Options to vnstatd >+# See vnstatd(8) for more details >+# Notes: >+# * Do not specify another PIDFILE but use the variable above to change the location >+# * Do not specify another CONFIGFILE but use the variable above to change the location >+VNSTATD_OPTS="" >+ >+# Wait x milliseconds after starting and check that daemon is still running. >+# See start-stop-daemon(8) for more details >+SSD_STARTWAIT=500 >diff -rupN old/net-analyzer/vnstat/files/vnstatd-r1.initd new/net-analyzer/vnstat/files/vnstatd-r1.initd >--- old/net-analyzer/vnstat/files/vnstatd-r1.initd 1970-01-01 01:00:00.000000000 +0100 >+++ new/net-analyzer/vnstat/files/vnstatd-r1.initd 2014-09-05 20:58:24.000000000 +0200 >@@ -0,0 +1,31 @@ >+#!/sbin/openrc-run >+# Copyright 1999-2014 Gentoo Foundation >+# Distributed under the terms of the GNU General Public License v2 >+# $Header: $ >+ >+extra_started_commands="reload" >+ >+depend() { >+ use net >+} >+ >+pidfile="${VNSTATD_PIDFILE:-/run/vnstat/vnstatd.pid}" >+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 is a flexible and robust way to update 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 $? >+} >diff -rupN old/net-analyzer/vnstat/files/vnstatd.systemd new/net-analyzer/vnstat/files/vnstatd.systemd >--- old/net-analyzer/vnstat/files/vnstatd.systemd 1970-01-01 01:00:00.000000000 +0100 >+++ new/net-analyzer/vnstat/files/vnstatd.systemd 2014-09-05 20:42:34.000000000 +0200 >@@ -0,0 +1,11 @@ >+[Unit] >+Description=vnstatd is a flexible and robust way to update vnStat databases >+ >+[Service] >+After=network-online.target >+User=vnstat >+ExecStart=/usr/bin/vnstatd --nodaemon >+ExecReload=/bin/kill -HUP $MAINPID >+ >+[Install] >+WantedBy=multi-user.target >diff -rupN old/net-analyzer/vnstat/files/vnstatd.tmpfile new/net-analyzer/vnstat/files/vnstatd.tmpfile >--- old/net-analyzer/vnstat/files/vnstatd.tmpfile 1970-01-01 01:00:00.000000000 +0100 >+++ new/net-analyzer/vnstat/files/vnstatd.tmpfile 2014-09-05 20:32:00.000000000 +0200 >@@ -0,0 +1 @@ >++d /run/vnstat 0775 vnstat vnstat - - >diff -rupN old/net-analyzer/vnstat/files/vnstat-r1.cron new/net-analyzer/vnstat/files/vnstat-r1.cron >--- old/net-analyzer/vnstat/files/vnstat-r1.cron 1970-01-01 01:00:00.000000000 +0100 >+++ new/net-analyzer/vnstat/files/vnstat-r1.cron 2014-09-05 22:18:32.000000000 +0200 >@@ -0,0 +1,7 @@ >+#!/bin/bash >+ >+# run vnstat if installed and at least one database exists >+ >+if [ -x /usr/bin/vnstat ] && [ `ls /var/lib/vnstat/ | wc -l` -ge 1 ] ; then >+ exec /usr/bin/vnstat -u >+fi >diff -rupN old/net-analyzer/vnstat/vnstat-1.12-r1.ebuild new/net-analyzer/vnstat/vnstat-1.12-r1.ebuild >--- old/net-analyzer/vnstat/vnstat-1.12-r1.ebuild 1970-01-01 01:00:00.000000000 +0100 >+++ new/net-analyzer/vnstat/vnstat-1.12-r1.ebuild 2014-09-05 22:30:51.000000000 +0200 >@@ -0,0 +1,94 @@ >+# Copyright 1999-2014 Gentoo Foundation >+# Distributed under the terms of the GNU General Public License v2 >+# $Header: $ >+ >+EAPI=5 >+inherit toolchain-funcs user systemd >+ >+DESCRIPTION="Console-based network traffic monitor that keeps statistics of network usage" >+HOMEPAGE="http://humdi.net/vnstat/" >+SRC_URI="http://humdi.net/vnstat/${P}.tar.gz" >+ >+LICENSE="GPL-2" >+SLOT="0" >+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86" >+IUSE="gd" >+ >+DEPEND="gd? ( media-libs/gd[png] )" >+RDEPEND=" >+ ${DEPEND} >+ !<sys-apps/openrc-0.13 >+" >+ >+pkg_setup() { >+ enewgroup vnstat >+ enewuser vnstat -1 -1 /dev/null vnstat >+} >+ >+src_prepare() { >+ tc-export CC >+ >+ sed -i 's:^DaemonUser.*:DaemonUser "vnstat":' cfg/vnstat.conf || die "Failed to set DaemonUser!" >+ sed -i 's:^DaemonGroup.*:DaemonGroup "vnstat":' cfg/vnstat.conf || die "Failed to set DaemonGroup!" >+ sed -i 's:^MaxBWethnone.*:# &:' cfg/vnstat.conf || die "Failed to comment out example!" >+ sed -i 's:vnstat[.]log:vnstatd.log:' cfg/vnstat.conf || die "Failed to adjust LogFile name!" >+ sed -i 's:^PidFile.*:PidFile "/run/vnstat/vnstatd.pid":' cfg/vnstat.conf || die "Failed to adjust PidFile directive!" >+} >+ >+src_compile() { >+ emake CFLAGS="${CFLAGS}" $(usex gd all '') >+} >+ >+src_install() { >+ use gd && dobin src/vnstati >+ dobin src/vnstat src/vnstatd >+ >+ exeinto /usr/share/${PN} >+ newexe "${FILESDIR}"/vnstat-r1.cron vnstat.cron >+ >+ insinto /etc >+ doins cfg/vnstat.conf >+ fowners root:vnstat /etc/vnstat.conf >+ >+ newconfd "${FILESDIR}"/vnstatd-r1.confd vnstatd >+ newinitd "${FILESDIR}"/vnstatd-r1.initd vnstatd >+ >+ systemd_newunit "${FILESDIR}"/vnstatd.systemd vnstatd.service >+ systemd_newtmpfilesd "${FILESDIR}"/vnstatd.tmpfile vnstatd.conf >+ >+ keepdir /var/lib/vnstat >+ fowners vnstat:vnstat /var/lib/vnstat >+ >+ use gd && doman man/vnstati.1 >+ doman man/vnstat.1 man/vnstatd.1 >+ >+ newdoc INSTALL README.setup >+ dodoc CHANGES README UPGRADE FAQ examples/vnstat.cgi >+} >+ >+pkg_postinst() { >+ # Workaround feature/bug #141619 >+ chown -R vnstat:vnstat "${ROOT}"/var/lib/vnstat >+ chown vnstat:vnstat "${ROOT}"/var/run/vnstatd >+ ewarn "vnStat db files owning user and group has been changed to \"vnstat\"." >+ >+ elog >+ elog "Repeat the following command for every interface you" >+ elog "wish to monitor (replace eth0):" >+ elog " vnstat -u -i eth0" >+ elog "and set correct permissions after that, e.g." >+ elog " chown -R vnstat:vnstat /var/lib/vnstat" >+ elog >+ elog "It is highly recommended to use the included vnstatd to update your" >+ elog "vnStat databases." >+ elog >+ elog "If you want to use the old cron way to update your vnStat databases," >+ elog "you have to install the cronjob manually:" >+ elog "" >+ elog " cp /usr/share/${PN}/vnstat.cron /etc/cron.hourly/vnstat" >+ elog "" >+ elog "Note: if an interface transfers more than ~4GB in" >+ elog "the time between cron runs, you may miss traffic." >+ elog "That's why using vnstatd instead of the cronjob is" >+ elog "the recommended way to update your vnStat databases." >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 522226
:
384266
|
384312
|
393014
|
394772