So it seems that I spoke too soon. I once again lost the ability to launch the apcupsd daemon. A little more research yielded the following results. Take these steps at your own risk.
My first clue was the apcupsd events log, which is located at
/etc/log/apcupsd.events.
EDIT: The log could be located at
/var/log/apcupsd.events.
- Code: Select all
cat apcupsd.events
Result:
- Code: Select all
2018-11-21 06:58:23 -0600 Valid lock file for pid=118, but not ours pid=115
2018-11-21 06:58:23 -0600 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.
2018-11-21 06:58:23 -0600 Valid lock file for pid=118, but not ours pid=115
2018-11-21 06:58:23 -0600 apcupsd error shutdown completed
The important bit is the lock file mismatch. The lock file itself is located at
/private/var/tmp/Lock.. (note that the two dots at the end are part of the filename.)
EDIT: The lock file could be located at
/private/var//tmp/LCK..- Code: Select all
cat Lock..
Result:
- Code: Select all
0000000118^@
Change the lock file entry to the valid lock PID.
- Code: Select all
sudo nano LCK..
Enter password. Using cursor and delete keys, replace the 8 with a 5.
- Code: Select all
0000000115^@
control O to write out.
control X to exit.
Reboot.
apcupsd starts normally.
- Code: Select all
2018-11-21 07:50:03 -0600 apcupsd 3.14.14 (31 May 2016) darwin startup succeeded
If you find you have this error, it's likely that the numbers in the above example will not always be the same. Again, there is some risk to mucking things up with this patch, but I think the risk is pretty low. Regardless, no warranty expressed or implied...