Description of problem: upsd and related programs fail to start apparently because /var/run/nut/ does not exist: systemd[1]: nut-server.service: Failed with result 'exit-code'. audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=nut-server comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed' systemd[1]: nut-server.service: Unit entered failed state. systemd[1]: nut-server.service: Main process exited, code=exited, status=1/FAILURE upsd[15817]: Can't chdir to /var/run/nut: No such file or directory upsd[15817]: Network UPS Tools upsd 2.7.4 upsd[15817]: Can't chdir to /var/run/nut: No such file or directory upsd[15817]: listening on ::1 port 3493 upsd[15817]: listening on 127.0.0.1 port 3493 upsd[15817]: listening on ::1 port 3493 upsd[15817]: listening on 127.0.0.1 port 3493 upsd[15817]: fopen /var/run/nut/upsd.pid: No such file or directory audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=nut-server comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' systemd[1]: Started Network UPS Tools - power devices information server. systemd[1]: nut-driver.service: Failed with result 'exit-code'. audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=nut-driver comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed' systemd[1]: nut-driver.service: Unit entered failed state. systemd[1]: Failed to start Network UPS Tools - power device driver controller. systemd[1]: nut-driver.service: Control process exited, code=exited status=1 upsdrvctl[15812]: Network UPS Tools - UPS driver controller 2.7.4 upsdrvctl[15812]: Driver failed to start (exit status=1) upsdrvctl[15812]: Network UPS Tools - Megatec/Q1 protocol USB driver 0.12 (2.7.4) upsdrvctl[15812]: Can't chdir to /var/run/nut: No such file or directory systemd[1]: Starting Network UPS Tools - power device driver controller... Version-Release number of selected component (if applicable): nut-2.7.4-1.fc24.x86_64 How reproducible: Steps to Reproduce: 1. dnf install nut nut-cgi nut-client 2. modify /etc/ups/ups.conf 3. systemctl start nut-server.service
Manually creating /var/run/nut with mkdir allows the service to start, but this is a temporary fix as /var/run is on tmpfs, also: upsd[16208]: /var/run/nut is world readable upsd[16208]: /var/run/nut is world readable The nut driver (blazer_usb) then fails due to SELinux: python3[16218]: SELinux is preventing blazer_usb from getattr access on the file /run/udev/data/c189:1. ***** Plugin catchall (100. confidence) suggests ************************** If you believe that blazer_usb should be allowed getattr access on the c189:1 file by default. Then you should report this as a bug. You can generate a local policy module to allow this access. Do allow this access for now by executing: # ausearch -c 'blazer_usb' --raw | audit2allow -M my-blazerusb # semodule -X 300 -i my-blazerusb.pp setroubleshoot[16218]: SELinux is preventing blazer_usb from getattr access on the file /run/udev/data/c189:1. For complete SELinux messages. run sealert -l b9e86179-d55c-43d3-8f73-251a55f7c2ae upsd[16208]: Can't connect to UPS [dsl_ups] (blazer_usb-dsl_ups): No such file or directory upsd[16208]: Can't connect to UPS [dsl_ups] (blazer_usb-dsl_ups): No such file or directory
Note that even after I manually create the directory, I still see this: upsd[16674]: fopen /var/run/nut/upsd.pid: No such file or directory and nothing appears in the dir. Is this a holdover from pre-systemd days?
Further, the blazer_usb driver program can't open the USB device files because it sets its uid & gid to 57 (nut), but the USB device files are owned by root.root and don't grant write permission to other. If blazer_usb is run by hand with "-a dsl_usb -u root", then it works.
> upsd[16208]: /var/run/nut is world readable /var/run/nut should be created by systemd-tmpfiles and it should have 0750 permissions there was missing ExecStartPre in nut-driver.service so this issue should be fixed The usb devices nut is interested in have dialout group set, nut is member of that group (see output of "id nut"). It seems that it's more likely selinux issue Selinux issue is tracked in bug #1339437
nut-2.7.4-3.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-1c864f40a5
nut-2.7.4-3.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-0d2525e306
nut-2.7.4-3.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-8f17c643d3
nut-2.7.4-3.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-8f17c643d3
nut-2.7.4-3.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-1c864f40a5
nut-2.7.4-3.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-0d2525e306
nut-2.7.4-4.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-8c02066db5
nut-2.7.4-4.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-8c02066db5
nut-2.7.4-4.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.
nut-2.7.4-3.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.
nut-2.7.4-3.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.