Description of problem: The nut-server is not able to connect to usb driver. The most probable cause is that driver is trying to create socket directly in /var/run directory where it does not have permission to write. It should probably be modofied to create the socket in the /var/run/nut directory. When I run /usr/sbin/usbhid-ups -a ups -u root -DD then the socket is created in /var/run, not in /var/run/nut. I dod not find any configuration option to change it. It seems to be hardcoded. Version-Release number of selected component (if applicable): nut-2.8.0-4.fc37.x86_64 How reproducible: Steps to Reproduce: 1. Configure usb ups. 2. Run nut. 3. Nut is unable to connect to ups. the upsc ups command displays Error: Driver not connected Actual results: Nut is not able to monitor UPS. Expected results: Nut is able to monitor UPS. Additional info:
Maybe the option --with-altpidpath=/var/run/nut should be added to the configure when compiling.
And also --with-statepath=/var/run/nut.
I tried to rebuild the rpms with these configure parameters: --with-statepath=/run/nut \ --with-pidpath=/run \ --with-altpidpath=/run/nut \ Current state is: systemctl status nut-monitor displays fopen /run/upsmon.pid: No such file or directory and /usr/lib/tmpfiles.d/nut-common.conf contains d /run/nut/nut 0770 nut dialout - - X /run/nut/nut d /run/nut 0770 nut dialout - - X /run/nut So I am not sure what are the correct parameters. Probably --with-statepath=/run/nut \ --with-pidpath=/run/nut \ The Error: Driver not connected was related to not running nut-driver service. In the 2.8.0 version you should enable nut-driver. But I did not test with original packages. Maybe it would not work since it creates socket in /run/nut. It would not create it in /run because of permissions.
I tested with --with-statepath=/run/nut \ --with-pidpath=/run/nut \ The results were quite interesting. nut-monitor tried to search for pid file in the correct directory /run/nut instead of /run, but /usr/lib/tmpfiles.d/nut-common.conf contained only d /run/nut/nut 0770 nut dialout - - X /run/nut/nut instead of d /run/nut 0770 nut dialout - - X /run/nut So this is probably also not the exact combination required. Or some patch is required. Moreover I found out the file name is /usr/lib/tmpfiles.d/nut-common.conf but the service units look for /usr/lib/tmpfiles.d/nut-client.conf
*** Bug 2148706 has been marked as a duplicate of this bug. ***
*** Bug 2143833 has been marked as a duplicate of this bug. ***
*** Bug 2127269 has been marked as a duplicate of this bug. ***
*** Bug 2150486 has been marked as a duplicate of this bug. ***
*** This bug has been marked as a duplicate of bug 2127269 ***