Created attachment 862092 [details] AVC Description of problem: After update to apcupsd-3.14.10-14.fc20.x86_64 from updates-testing, I receive the AVC. Downgrade to the -13 release fixes the problem. Version-Release number of selected component (if applicable): apcupsd-3.14.10-14.fc20.x86_64 How reproducible: always Steps to Reproduce: 1. install the package 2. start (or restart) the daemon 3. Actual results: AVC Expected results: No AVC Additional info: My APC unit uses USB, so serial lock files do not make sense here anyway.
Tried apcupsd-3.14.11-1.fc20.x86_64 with same result. :-( From system log: Feb 18 21:51:53 vfr systemd[1]: Starting APC UPS Power Control Daemon for Linux... Feb 18 21:51:53 vfr systemd[1]: Started APC UPS Power Control Daemon for Linux. Feb 18 21:51:53 vfr apcupsd[5368]: Cannot create /etc/apcupsd/LCK.. serial port lock file: ERR=Permission denied Feb 18 21:51:53 vfr apcupsd[5368]: apcupsd FATAL ERROR in apcupsd.c at line 281 Unable to create UPS lock file. If apcupsd or apctest is already running, please stop it and run this program again. Feb 18 21:51:53 vfr apcupsd[5368]: apcupsd error shutdown completed Feb 18 21:51:53 vfr dbus[656]: [system] Activating service name='org.fedoraproject.Setroubleshootd' (using servicehelper) Feb 18 21:51:53 vfr apcupsd[5368]: apcupsd FATAL ERROR in apcupsd.c at line 281 Feb 18 21:51:53 vfr apcupsd[5368]: Unable to create UPS lock file. Feb 18 21:51:53 vfr apcupsd[5368]: If apcupsd or apctest is already running, Feb 18 21:51:53 vfr apcupsd[5368]: please stop it and run this program again. UPS is APC Backup UPS ES 750, which has USB -- not serial.
I have this on Rawhide: Feb 21 01:54:37 adam.happyassassin.net apcupsd[1723]: Lock file data error: Feb 21 01:54:37 adam.happyassassin.net apcupsd[1723]: apcupsd FATAL ERROR in apcupsd.c at line 281 Feb 21 01:54:37 adam.happyassassin.net apcupsd[1723]: Unable to create UPS lock file. Feb 21 01:54:37 adam.happyassassin.net apcupsd[1723]: If apcupsd or apctest is already running, Feb 21 01:54:37 adam.happyassassin.net apcupsd[1723]: please stop it and run this program again. Feb 21 01:54:37 adam.happyassassin.net apcupsd[1723]: apcupsd FATAL ERROR in apcupsd.c at line 281 If apcupsd or apctest is already running, Feb 21 01:54:37 adam.happyassassin.net apcupsd[1723]: [23B blob data] Feb 21 01:54:37 adam.happyassassin.net apcupsd[1723]: apcupsd error shutdown completed Feb 21 01:54:37 adam.happyassassin.net systemd[1]: apcupsd.service: main process exited, code=exited, status=1/FAILURE oddly, no "Cannot create /etc/apcupsd/LCK.. serial port lock file: ERR=Permission denied" line, but otherwise the same.
Why is it creating a LCK file in /etc?
I've no idea. https://bugzilla.redhat.com/show_bug.cgi?id=1047535 may be somehow relevant.
Probably the same problem. Should move the LCK file to the /var/lib directory also.
So something possibly interesting in relation to this, though I'm not sure how: my system is an old, old install, dating back to pre-/usr move. I did the F16->f17 (usr move) upgrade with yum, and did the /usr move manually. It looks like I never turned /var/lock into a symlink to /run/lock , as it's supposed to be now. And I have a /var/lock/LCK.. file. That seems like it may possibly be relevant to this, but I'm not 100% sure. I'll have to see if the AVC stops happening if I fix up /var/lock .
OK, so the problem here is that somehow, apcupsd's build process decides to use /etc/apcupsd as LOCKDIR. What apcupsd does is this: # set the default serial port lock director for LOCKDIR in "/var/lock" "/var/spool/locks" "/etc/apcupsd" do if test -d $LOCKDIR then break; fi done so somehow, 'test -d /var/lock' is failing in our build environment. It works on EPEL 6, but fails on F19, F20 and Rawhide. This could be to do with /var/lock being a symlink to /run/lock now, but I don't think it's quite that simple: [adamw@adam kernel-asoc]$ ls -dl /var/lock lrwxrwxrwx. 1 root root 9 Feb 26 18:25 /var/lock -> /run/lock [adamw@adam kernel-asoc]$ test -d /var/lock [adamw@adam kernel-asoc]$ echo $? 0 [adamw@adam kernel-asoc]$ so I think perhaps the symlink really doesn't exist in the build environment. I guess we either need to fix that, patch apcupsd to look for and use /run/lock directly, or just hardwire /var/lock on the basis we know that's what we want.
*** Bug 1070961 has been marked as a duplicate of this bug. ***
If we change the check to for LOCKDIR in "/run/lock" "/var/lock" "/var/spool/locks" "/etc/apcupsd" do if test -d $LOCKDIR then break; fi done Does it fix it forever?
my crystal ball is on the blink at the moment... I don't know, I haven't even tested that it fixes it *now*. Like I said, test -d does work with a symlink, so I don't think the problem is just that /var/lock is a symlink, I think it may just not exist in the build environment. I'm *presuming* at least /run/lock does, but I haven't checked, yet.
This problem is still there even with apcupsd-3.14.11-1.fc20.x86_64 I just got from updates-testing. My workaround was to simply comment out the "LOCKFILE" line in the conf file: # LOCKFILE <path to lockfile> # Path for device lock file. Not used on Win32. #LOCKFILE /etc/apcupsd since I have a USB apc and it doesn't need a lock
apcupsd-3.14.12-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/FEDORA-2014-2662/apcupsd-3.14.12-1.fc20
apcupsd-3.14.12-1.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/FEDORA-2014-2685/apcupsd-3.14.12-1.fc19
This version of apcupsd-3.14.12-1.fc20 fixes the AVC for me.
Package apcupsd-3.14.12-1.fc20: * should fix your issue, * was pushed to the Fedora 20 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing apcupsd-3.14.12-1.fc20' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-2662/apcupsd-3.14.12-1.fc20 then log in and leave karma (feedback).
apcupsd-3.14.12-1.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.
apcupsd-3.14.12-1.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.