Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#44965 - [apcupsd] doesn't create its lock dir, crashes.

Attached to Project: Community Packages
Opened by Cliff L. Biffle (cbiffle) - Friday, 15 May 2015, 02:39 GMT
Last edited by Sergej Pupykin (sergej) - Friday, 15 May 2015, 10:31 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Florian Pritz (bluewind)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The systemd service file installed by the apcupsd 3.14.13-1 package does not create the /run/apcupsd/ directory, where apcupsd will try to deposit its lockfile.

apcupsd itself handles this poorly:

May 14 19:34:13 anansi apcupsd[2080]: apcupsd FATAL ERROR in apcupsd.c at line 2
May 14 19:34:13 anansi apcupsd[2080]: Unable to create UPS lock file.
May 14 19:34:13 anansi apcupsd[2080]: If apcupsd or apctest is already running,
May 14 19:34:13 anansi apcupsd[2080]: please stop it and run this program again.
May 14 19:34:13 anansi systemd[1]: apcupsd.service: main process exited, code=ex
May 14 19:34:13 anansi systemd[1]: Unit apcupsd.service entered failed state.

The fix I've applied locally is to alter the service file to create the directory. See the attached diff.


Steps to reproduce:
- pacman -S apcupsd
- systemctl start apcupsd
- journalctl -xe
This task depends upon

Closed by  Sergej Pupykin (sergej)
Friday, 15 May 2015, 10:31 GMT
Reason for closing:  Fixed
Comment by Doug Newgard (Scimmia) - Friday, 15 May 2015, 02:56 GMT
Don't do that. The directory creation is handled by systemd-tmpfiles. If it's not getting created for you when the system starts, figure out why.

Bluewind, Sergej, I'm assigning this because it can be a problem when the package is installed but the system not restarted. The install file should call systemd-tmpfiles --create.
Comment by Cliff L. Biffle (cbiffle) - Friday, 15 May 2015, 03:01 GMT
Thanks! I can confirm that the package is installing `apcupsd-tmpfiles.conf` and that `systemd-tmpfiles --create` creates the /run/apcupsd directory as expected. The package does not currently have an `install` script.

Loading...