Apcupsd service (APC UPS daemon) from os-apcupsd plugin

Started by geobarrod, July 11, 2023, 10:27:54 PM

Previous topic - Next topic
Hi,

After upgrade from 22.7.11_1-amd64 to 23.1.11-amd64 the Apcupsd service stop work and this is a fragment of error in daemon log '/var/log/apcupsd/latest.log':

<27>1 2023-07-11T16:18:23-04:00 apcupsd 94496 - [meta sequenceId="1"] Lock file data error: �
<27>1 2023-07-11T16:18:23-04:00 apcupsd 94496 - [meta sequenceId="2"] apcupsd FATAL ERROR in apcupsd.c at line 221
Unable to create UPS lock file.
  If apcupsd or apctest is already running,
  please stop it and run this program again.
<27>1 2023-07-11T16:18:23-04:00 apcupsd 94496 - [meta sequenceId="3"] Lock file data error:
<27>1 2023-07-11T16:18:23-04:00 apcupsd 94496 - [meta sequenceId="4"] apcupsd error shutdown completed


When run apctest command show this stderr:

2023-07-11 16:15:12 apctest 3.14.14 (31 May 2016) freebsd
Checking configuration ...
sharenet.type = Network & ShareUPS Disabled
cable.type = USB Cable
mode.type = USB UPS Driver
apctest FATAL ERROR in apctest.c at line 313
Unable to create UPS lock file.
  If apcupsd or apctest is already running,
  please stop it and run this program again.
apctest error termination completed.


and the service not work.

I have created an OPNSense account specifically to reply to this post. This is to confirm that I also encounter the same issue. And yes, also started to encounter the issue after upgrading to 23.1.11. It's still an issue on 23.7.1. I hope a fix will be released soon since the plug-in is really great and I couldn't find any replacement for APC UPS'.

I can confirm the bug, I upgraded to 23.7.1_3, and the bug stills persist, same error here


Update: due to a SSD failure, I had to replace the SSD, reinstall OPNSense and restore the configuration. As part of the process, I had to reinstall all the plugins. That has fixed the apcupsd plugin. Running on OPNSense ver. 23.7.5 at the time of writing and apcupsd works as expected.

I had the same issue after a forced restart due to a kernel panic.

When looking into the plugin's config files (at /usr/local/etc/apcupsd/apcupsd.conf), I was able to get the location of the lock file (inside /var/spool/lock).

Just deleted it after making sure that the apcupsd was not running, restart working successfully.