From: Adolf Belka <adolf.belka@ipfire.org>
To: development@lists.ipfire.org
Cc: Adolf Belka <adolf.belka@ipfire.org>
Subject: [PATCH 3/3] ovpnmain.cgi: Fixes bug13832 - restart collectd initscript on openvpn server status change
Date: Mon, 17 Mar 2025 20:51:23 +0100 [thread overview]
Message-ID: <20250317195123.2092-3-adolf.belka@ipfire.org> (raw)
In-Reply-To: <20250317195123.2092-1-adolf.belka@ipfire.org>
- When the openvpn server status is changed from RUNNING to STOPPED or vice versa then
the collectd initscript is restarted to ensure that the include openvpn plugin line
in the collectd.conf file is correctly uncommented or not.
Fixes: bug13832
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
html/cgi-bin/ovpnmain.cgi | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
index 20f256f4b..f16ba0591 100644
--- a/html/cgi-bin/ovpnmain.cgi
+++ b/html/cgi-bin/ovpnmain.cgi
@@ -782,6 +782,10 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'start ovpn server'} ||
&General::system("/usr/local/bin/openvpnctrl", "-k");
&emptyserverlog();
}
+
+ # restart collectd to uncomment include openvpn plugin command if openvpn pid exists
+ &General::system("/usr/local/bin/collectdctrl", "restart");
+
# #restart openvpn server
# if ($cgiparams{'ACTION'} eq $Lang::tr{'restart ovpn server'}){
#workarund, till SIGHUP also works when running as nobody
--
2.49.0
next prev parent reply other threads:[~2025-03-17 19:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 19:51 [PATCH 1/3] collectd: Fixes bug13832 - uncomments include openvpn plugin only if openvpn is running 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 ` Adolf Belka [this message]
2025-03-19 15:56 ` [PATCH 1/3] collectd: Fixes bug13832 - uncomments include openvpn plugin only if openvpn is running Michael Tremer
2025-03-19 17:09 ` 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=20250317195123.2092-3-adolf.belka@ipfire.org \
--to=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