Manuel Wolfshant
2022-Jan-11 10:22 UTC
[Nut-upsuser] ups services not starting at boot time
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
On Tue, 11 Jan 2022, Manuel Wolfshant wrote:> On 1/11/22 11:46, Eyal Lebedinsky wrote: >> 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.htmlI looked at this file, and then looked for examples. They all seem to talk about cron like activity. It would be interesting to see an example of "wait until service has started, with max of 20sec" Would it be possible to avoid systemd timers by adding "ExecStartPre=/bin/sleep 20" in the [Service] section of nut-server.service? Roger
Eyal Lebedinsky
2022-Jan-12 04:27 UTC
[Nut-upsuser] ups services not starting at boot time
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.htmlHad 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. -- Eyal Lebedinsky (eyal at eyal.emu.id.au)