Bug 812825 - nut-client package does not create /var/run/nut directory
nut-client package does not create /var/run/nut directory
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: nut (Show other bugs)
16
All Linux
low Severity medium
: ---
: ---
Assigned To: Michal Hlavinka
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-16 06:59 EDT by Jaroslav Kysela
Modified: 2013-12-30 23:09 EST (History)
3 users (show)

See Also:
Fixed In Version: nut-2.6.3-2.fc16
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-04-26 16:13:02 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jaroslav Kysela 2012-04-16 06:59:52 EDT
Install nut-client package, configure /etc/ups/upsmon.conf and run 'nut-monitor' service:

upsmon[26616]: writepid: fopen /var/run/nut/upsmon.pid: No such file or directory

The /var/run/nut directory is missing
Comment 1 Fedora Update System 2012-04-16 08:33:09 EDT
nut-2.6.3-2.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/nut-2.6.3-2.fc16
Comment 2 Fedora Update System 2012-04-16 08:33:18 EDT
nut-2.6.3-2.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/nut-2.6.3-2.fc17
Comment 3 Fedora Update System 2012-04-16 17:56:24 EDT
Package nut-2.6.3-2.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing nut-2.6.3-2.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-5987/nut-2.6.3-2.fc17
then log in and leave karma (feedback).
Comment 4 Fedora Update System 2012-04-26 16:13:02 EDT
nut-2.6.3-2.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 5 Fedora Update System 2012-04-27 01:48:42 EDT
nut-2.6.3-2.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 6 Dan Ziemba 2012-08-28 01:31:31 EDT
This is still a problem on Fedora 16 x86_64 with nut and nut-client 2.6.5
Comment 7 Michal Hlavinka 2012-09-05 07:44:11 EDT
what do you mean by "still"? It was fixed in nut 2.6.3-2 and I just verified all parts of the fix are still in place. 

So, what's the behavior you see? It (=systemd) should create this directory when you start nut-monitor.service in ExecStartPre section. Do you see any error messages in logs?
Comment 8 Dan Ziemba 2012-09-06 14:42:58 EDT
I said still because the report was closed a while ago, but this was the first time I have tried the package on fedora and I experienced the same problem.  When I started the nut-monitor service, I got the same error message as the original report.  After creating the directory manually, the service started fine.  /etc/tmpfiles.d/nut-client.conf exists, so I don't know why the directory wasn't created.
Comment 9 Michal Hlavinka 2012-09-11 12:15:36 EDT
and do you see:
upsmon[26616]: writepid: fopen /var/run/nut/upsmon.pid: No such file or directory
or
upsmon[13983]: fopen /var/run/nut/upsmon.pid: No such file or directory

The first one was this bug - /var/run/nut was missing.
The second one is debug output - it checks whether there is running instance. If it is not already running (usual case), upsmon.pid does not exist and it logs this message.
Comment 10 Dan Ziemba 2012-09-12 10:52:48 EDT
Yes, I believe the fact that directory is missing is the bug. /etc/tmpfiles.d/nut-client.conf should cause systemd to create the directory on first run of the service but for some reason does not. Perhaps this is actually a systemd bug?
Comment 11 Michal Hlavinka 2012-09-12 11:32:41 EDT
so you see the "writepid" error message (not the "fopen" one) and you verified that after systemctl start nut-monitor.service, there is no /var/run/nut directory. Is that correct? If so, please try to reproduce again and attach your /var/log/messages.
Comment 12 Bill McGonigle 2013-12-30 23:09:24 EST
nut-2.6.5-12.fc19.x86_64 (yum install nut):

Dec 30 23:02:45 ivorytower systemd[1]: Starting Network UPS Tools - power device driver controller...
Dec 30 23:02:45 ivorytower systemd[1]: Service nut-driver.service is not needed anymore. Stopping.
Dec 30 23:02:45 ivorytower systemd[1]: Requested transaction contradicts existing jobs: File exists
Dec 30 23:02:45 ivorytower upsdrvctl[6972]: Can't chdir to /var/run/nut: No such file or directory
Dec 30 23:02:45 ivorytower upsdrvctl[6972]: Network UPS Tools - Generic HID driver 0.37 (2.6.5)
Dec 30 23:02:45 ivorytower upsdrvctl[6972]: USB communication driver 0.31
Dec 30 23:02:45 ivorytower upsdrvctl[6972]: Driver failed to start (exit status=1)
Dec 30 23:02:45 ivorytower upsdrvctl[6972]: Network UPS Tools - UPS driver controller 2.6.5
Dec 30 23:02:45 ivorytower systemd[1]: nut-driver.service: control process exited, code=exited status=1
Dec 30 23:02:45 ivorytower systemd[1]: Failed to start Network UPS Tools - power device driver controller.
Dec 30 23:02:45 ivorytower systemd[1]: Unit nut-driver.service entered failed state.

I did:
  mkdir /var/run/nut
  chown nut:nut /var/run/nut

and that seems to be good enough for it to work.

Note You need to log in before you can comment on or make changes to this bug.