[3/3] ovpnmain.cgi: Fixes bug13832 - restart collectd initscript on openvpn server status change
Commit Message
- 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(+)
@@ -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