From: Michael Tremer <michael.tremer@ipfire.org>
To: Adolf Belka <adolf.belka@ipfire.org>
Cc: development@lists.ipfire.org
Subject: Re: [PATCH 1/3] collectd: Fixes bug13832 - uncomments include openvpn plugin only if openvpn is running
Date: Wed, 19 Mar 2025 15:56:06 +0000 [thread overview]
Message-ID: <E015E62B-B561-4CBC-9C19-588F83D343A5@ipfire.org> (raw)
In-Reply-To: <20250317195123.2092-1-adolf.belka@ipfire.org>
Hello Adolf,
In this patch you are checking whether OpenVPN is actually running.
Should we not check whether it is enabled? That would avoid any kind of races that we might see when collectd is being started before OpenVPN.
-Michael
> On 17 Mar 2025, at 19:51, Adolf Belka <adolf.belka@ipfire.org> wrote:
>
> - Added code to check if openvpn.pid exists and only then uncomment the include openvpn
> plugin line in collectd.conf
> - Tested out on my vm testbed and the include openvpn plugin line in collectd.conf is
> only uncommented if the openvpn server is run ning and has a pid.
>
> Fixes: Bug13832
> Tested-by: Adolf Belka <adolf.belka@ipfire.org>
> Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
> ---
> src/initscripts/system/collectd | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/src/initscripts/system/collectd b/src/initscripts/system/collectd
> index 263511fc7..f86b64e9d 100644
> --- a/src/initscripts/system/collectd
> +++ b/src/initscripts/system/collectd
> @@ -143,6 +143,13 @@ case "$1" in
> sed -i -e "s|^#LoadPlugin swap|LoadPlugin swap|g" /etc/collectd.conf
> fi
>
> + # Enable openvpn plugin if openvpn.pid found
> + if [ ! -e /var/run/openvpn.pid ]; then
> + sed -i -e 's|^include "/etc/collectd.vpn"$|#include "/etc/collectd.vpn"|g' /etc/collectd.conf
> + else
> + sed -i -e 's|^#include "/etc/collectd.vpn"$|include "/etc/collectd.vpn"|g' /etc/collectd.conf
> + fi
> +
> if [ $(date +%Y) -gt 2011 ]; then
> boot_mesg "Starting Collection daemon..."
> /usr/sbin/collectd -C /etc/collectd.conf
> --
> 2.49.0
>
>
next prev parent reply other threads:[~2025-03-19 15:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 19:51 Adolf Belka
2025-03-17 19:51 ` [PATCH 2/3] collectd.conf: Fixes bug13832 - include openvpn plugin line commented out by default Adolf Belka
2025-03-17 19:51 ` [PATCH 3/3] ovpnmain.cgi: Fixes bug13832 - restart collectd initscript on openvpn server status change Adolf Belka
2025-03-19 15:56 ` Michael Tremer [this message]
2025-03-19 17:09 ` [PATCH 1/3] collectd: Fixes bug13832 - uncomments include openvpn plugin only if openvpn is running Adolf Belka
2025-03-21 12:34 ` Michael Tremer
2025-03-21 12:41 ` Michael Tremer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E015E62B-B561-4CBC-9C19-588F83D343A5@ipfire.org \
--to=michael.tremer@ipfire.org \
--cc=adolf.belka@ipfire.org \
--cc=development@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox