commit: 2753b05b485e13c49d138d0fbd2b24773304cb3a Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Sat Jul 12 06:00:07 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sat Jul 12 06:00:07 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2753b05b
net-analyzer/vnstat: fix paths in init script & friends In 4315a67f1f687fa721f675d2b15f486e77b6c9a8, I moved us to using the build system rather than installing files manually, but neglected that we had a bunch of auxiliary files that referenced the old paths. Fix that. Bug: https://bugs.gentoo.org/957055 Closes: https://bugs.gentoo.org/959388 Signed-off-by: Sam James <sam <AT> gentoo.org> net-analyzer/vnstat/files/vnstat.cron-r2 | 7 ++++++ net-analyzer/vnstat/files/vnstatd.initd-r3 | 29 ++++++++++++++++++++++ net-analyzer/vnstat/files/vnstatd.systemd-r1 | 11 ++++++++ ...vnstat-2.13-r1.ebuild => vnstat-2.13-r2.ebuild} | 6 ++--- net-analyzer/vnstat/vnstat-9999.ebuild | 8 +++--- 5 files changed, 54 insertions(+), 7 deletions(-) diff --git a/net-analyzer/vnstat/files/vnstat.cron-r2 b/net-analyzer/vnstat/files/vnstat.cron-r2 new file mode 100644 index 000000000000..98ed9734fcc7 --- /dev/null +++ b/net-analyzer/vnstat/files/vnstat.cron-r2 @@ -0,0 +1,7 @@ +#!/bin/bash + +# run vnstat if installed and at least one database exists + +if [ -x /usr/sbin/vnstat ] && [ `ls /var/lib/vnstat/ | wc -l` -ge 1 ] ; then + exec /usr/sbin/vnstat -u +fi diff --git a/net-analyzer/vnstat/files/vnstatd.initd-r3 b/net-analyzer/vnstat/files/vnstatd.initd-r3 new file mode 100644 index 000000000000..31f49d2a8af3 --- /dev/null +++ b/net-analyzer/vnstat/files/vnstatd.initd-r3 @@ -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/sbin/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 $? +} diff --git a/net-analyzer/vnstat/files/vnstatd.systemd-r1 b/net-analyzer/vnstat/files/vnstatd.systemd-r1 new file mode 100644 index 000000000000..7136a0c6053c --- /dev/null +++ b/net-analyzer/vnstat/files/vnstatd.systemd-r1 @@ -0,0 +1,11 @@ +[Unit] +Description=vnStat network traffic monitor +Documentation=man:vnstatd(1) man:vnstat(1) man:vnstat.conf(5) +After=network-online.target + +[Service] +ExecStart=/usr/sbin/vnstatd --nodaemon +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/net-analyzer/vnstat/vnstat-2.13-r1.ebuild b/net-analyzer/vnstat/vnstat-2.13-r2.ebuild similarity index 90% rename from net-analyzer/vnstat/vnstat-2.13-r1.ebuild rename to net-analyzer/vnstat/vnstat-2.13-r2.ebuild index adc51f6ef0b8..cbd84ff3a5d6 100644 --- a/net-analyzer/vnstat/vnstat-2.13-r1.ebuild +++ b/net-analyzer/vnstat/vnstat-2.13-r2.ebuild @@ -62,12 +62,12 @@ src_install() { default exeinto /usr/share/${PN} - newexe "${FILESDIR}"/vnstat.cron-r1 vnstat.cron + newexe "${FILESDIR}"/vnstat.cron-r2 vnstat.cron newconfd "${FILESDIR}"/vnstatd.confd-r1 vnstatd - newinitd "${FILESDIR}"/vnstatd.initd-r2 vnstatd + newinitd "${FILESDIR}"/vnstatd.initd-r3 vnstatd - systemd_newunit "${FILESDIR}"/vnstatd.systemd vnstatd.service + systemd_newunit "${FILESDIR}"/vnstatd.systemd-r1 vnstatd.service newtmpfiles "${FILESDIR}"/vnstatd.tmpfile vnstatd.conf newdoc INSTALL README.setup diff --git a/net-analyzer/vnstat/vnstat-9999.ebuild b/net-analyzer/vnstat/vnstat-9999.ebuild index 4bcb715c8cfa..cbd84ff3a5d6 100644 --- a/net-analyzer/vnstat/vnstat-9999.ebuild +++ b/net-analyzer/vnstat/vnstat-9999.ebuild @@ -24,7 +24,7 @@ else ) " - KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86" + KEYWORDS="~amd64 arm arm64 ~hppa ~mips ppc ~ppc64 ~riscv ~sparc ~x86" BDEPEND="verify-sig? ( sec-keys/openpgp-keys-teemutoivola )" fi @@ -62,12 +62,12 @@ src_install() { default exeinto /usr/share/${PN} - newexe "${FILESDIR}"/vnstat.cron-r1 vnstat.cron + newexe "${FILESDIR}"/vnstat.cron-r2 vnstat.cron newconfd "${FILESDIR}"/vnstatd.confd-r1 vnstatd - newinitd "${FILESDIR}"/vnstatd.initd-r2 vnstatd + newinitd "${FILESDIR}"/vnstatd.initd-r3 vnstatd - systemd_newunit "${FILESDIR}"/vnstatd.systemd vnstatd.service + systemd_newunit "${FILESDIR}"/vnstatd.systemd-r1 vnstatd.service newtmpfiles "${FILESDIR}"/vnstatd.tmpfile vnstatd.conf newdoc INSTALL README.setup
