Summary: | collectd-5.12.0 openvpn errors if openvpn not used | ||
---|---|---|---|
Product: | IPFire | Reporter: | Adolf Belka <adolf.belka> |
Component: | --- | Assignee: | Adolf Belka <adolf.belka> |
Status: | ASSIGNED --- | QA Contact: | |
Severity: | Minor Usability | ||
Priority: | - Unknown - | ||
Version: | 2 | ||
Hardware: | all | ||
OS: | Unspecified |
Description
Adolf Belka
2025-03-16 09:46:27 UTC
I tested this out on a vm system. A fresh install without the OpenVPN enabled gave the log messages found by other users on the forum. I then created the root and host certificates for the OpenVPN server and then selected enabled on Red and saved and then started the OpenVPN server. After that the collect openvpn error messages stopped. So commenting out the include openvpn plugin line and checking if OpenVPN is enabled when starting collectd with the initscript and using that to uncomment the include openvpn plugin line will work. Additionally when the openvpn is enabled it will need to run the collectd restart command to ensure that the collectd openvpn plugin is then working. Did some further checking out. Just enabling the OpenVPN server on Red does not create contents in the /var/run/ovpnserver.log file. The OpenVPN server has to be started. Once it is started then the ovpnserver.log file has the contents that the collectd openvpn plugin is expecting and there are no error messages. However, once that ovpnserver.log file has been created it is never deleted. So after once starting the OpenVPN server you can then stop it, disable it on all interfaces and remove the x509 certficate set so you end up with nothing defined in the OpenVPN WUI page but ovpnserver.log is still present with the expected contents so collectd will never again complain about it. However it still makes sense to comment out the openvpn plugin include statement in collectd.conf but this needs to be triggered by OpenVPN being started and successfully running. So it can't be done by simply doing a readhash from the openvpn settings file. I will look at how to get the running status. openvpnctrl.c has no status command for the running status but it must be found to be able to show Running in green rather than Stopped in red. So I will have a look through the ovpnmain.cgi code further. Turned out to be easier than I thought. The status is shown as RUNNING in green if the openvpn.pid file exists. So basically we uncomment the include openvpn plugin line if /var/run/openvpn.pid exists. Then we also need to restart the collectd initscript if the OpenVPN server is started, after the WUI page update with the status is shown. will test out the required changes on my vm testbed. Patch set fix for this bug submitted to the dev mailing list and patchwork. https://lists.ipfire.org/development/20250317195123.2092-1-adolf.belka@ipfire.org/T/#t https://patchwork.ipfire.org/project/ipfire/list/?series=4786 |