From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4ZHtbv5qKzz32yp for ; Wed, 19 Mar 2025 15:56:11 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R10" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4ZHtbr1YJkz32p7 for ; Wed, 19 Mar 2025 15:56:08 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4ZHtbq2L6Xz5Wk; Wed, 19 Mar 2025 15:56:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1742399767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hr+8HKJssBnogXkZ+goo594O0p/9KbNkutfTx6RuX4E=; b=K5yF4Jlm8K5EsRSA4NdXgXypYBfV+AX8dMW571frNVmBuJurKPctKANcJrJ5MeMdWRetJk UuUJyqt7sdxBS8p2jimSRpldEE+5wQ2bADyAflm/sPX24X+CrTquz0iSfYVAJcqu9k2QtS 5O5h3fwf4PZ79xQ3w9Hmri/09AdnuHggfo+YLyS1Fe94Y4UC4i6p7UTkUdWcZds2xBSYUU 0F6TdRKuAgrf08hUAQBLPe8pSp/DdHfdPkz5P3lYyJFaSdv1HaJlJ3xt1lF0Ald1vLr3WC 6InEdcihRciy17oQqvOHUGfisdVLlCpgHHQIJdiSnkIrhuDE3jhTwuOGqKieqw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1742399767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hr+8HKJssBnogXkZ+goo594O0p/9KbNkutfTx6RuX4E=; b=eGkFDd+KL0LUwt48a2Cc/b46ztHtARM9hG4ul5KDdvfq9nBd72HnhDmN9jpZ/Oafn+FewL sdprbKMfq3xmUVAA== Content-Type: text/plain; charset=us-ascii Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: Mime-Version: 1.0 Subject: Re: [PATCH 1/3] collectd: Fixes bug13832 - uncomments include openvpn plugin only if openvpn is running From: Michael Tremer In-Reply-To: <20250317195123.2092-1-adolf.belka@ipfire.org> Date: Wed, 19 Mar 2025 15:56:06 +0000 Cc: development@lists.ipfire.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20250317195123.2092-1-adolf.belka@ipfire.org> To: Adolf Belka 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 wrote: >=20 > - 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. >=20 > Fixes: Bug13832 > Tested-by: Adolf Belka > Signed-off-by: Adolf Belka > --- > src/initscripts/system/collectd | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > 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 >=20 > + # 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 > --=20 > 2.49.0 >=20 >=20