Manuel Wolfshant
2022-Jan-12 05:21 UTC
[Nut-upsuser] ups services not starting at boot time
On 1/12/22 06:27, Eyal Lebedinsky wrote:> > On 11/01/2022 21.22, Manuel Wolfshant wrote: >> On 1/11/22 11:46, Eyal Lebedinsky wrote: >>> Jan 11 19:29:19 e7.eyal.emu.id.au upsdrvctl[1612]: Network UPS Tools >>> - Generic HID driver 0.41 (2.7.4) >>> Jan 11 19:29:19 e7.eyal.emu.id.au upsdrvctl[1612]: USB communication >>> driver 0.33 >>> Jan 11 19:29:19 e7.eyal.emu.id.au upsdrvctl[1612]: No matching HID >>> UPS found >>> Jan 11 19:29:19 e7.eyal.emu.id.au upsdrvctl[1610]: Driver failed to >>> start (exit status=1) >> >> Here is your culprit, the UPS is not seen in the moment the driver >> tries to talk with it. Use a monotonic timer to delay the start of >> the service by, say, 20 secs or so. >> >> https://www.freedesktop.org/software/systemd/man/systemd.timer.html > > Had a read and it is more than I am ready to risk my lack of knowledge > of systemd, so I just added > ????systemctl restart nut-driver > to my /etc/rc.d/rc.local and it seems to do the trick. >That's one way to do it.Or you could 1. Save the below content as /usr/lib/systemd/system/nut-driver.timer <----cut from here ---> [Unit] Description=Delay startup of nut-driver by as many seconds as specified in the [Timer] section Documentation=https://www.freedesktop.org/software/systemd/man/systemd.timer.html [Timer] OnBootSec=20 <--- to here ---> 2. Run the following commands: #systemctl disable nut-driver #systemctl enable nut-driver.timer #reboot? ## for testing purposes; you can also emulate by adding ??? ??? ??? ??? ??? #for testing purposes ??? ??? ??? ??? ??? OnActiveSec=20 to the [Timer section] That should do it. wolfy
On 1/11/22 11:21 PM, Manuel Wolfshant wrote:> 2. Run the following commands: > > #systemctl disable nut-driver > > #systemctl enable nut-driver.timerWhen I run this command, I get this warning: # systemctl enable nut-driver.timer The unit files have no installation config (WantedBy=, RequiredBy=, Also=, Alias= settings in the [Install] section, and DefaultInstance= for template units). This means they are not meant to be enabled using systemctl. Possible reasons for having this kind of units are: ? A unit may be statically enabled by being symlinked from another unit's .wants/ or .requires/ directory. ? A unit's purpose may be to act as a helper for some other unit which has a requirement dependency on it. ? A unit may be started when needed via activation (socket, path, timer, D-Bus, udev, scripted systemctl call, ...). ? In case of template units, the unit is meant to be enabled with some instance name specified. I don't think it's loading: # systemctl | grep nut ? nut-driver.service loaded failed failed Network UPS Tools - power device driver controller ? nut-monitor.service loaded failed failed Network UPS Tools - power device monitor and shutdown controller nut-server.service loaded active running Network UPS Tools - power devices information server