I'm trying to better understand OffDelay and OnDelay: http://networkupstools.org/docs/man/usbhid-ups.html#_extra_arguments My server requires ~3? minutes to shut itself down. Considering this I'm comfortable setting OffDelay to 300 (five minutes). How does this work in conjunction with the UPS hardware? Does NUT immediately send a command to the UPS to wait for 300 seconds and then shut itself down, thereby allowing the server enough time to safely shut itself down as well? This is the only way I can think of that the arrangement can work. As it's naturally impossible for a turned-off computer to send any command anywhere, an option for sending a "take-this-now-but act-on-it-later" command surely must exist. I'll be initiating my own shutdown sequence as a result of NOTIFYCMD with a NOTIFYTYPE of ONBATT. My process will poll battery status for five minutes (to reduce false positives) before finally deciding to send individual shutdown commands to the server, NAS, other devices, etc. In other words, I'm going to write my own upssched, suited specifically to my platform and configuration needs. Given this configuration, at what point will the 300 seconds start counting down? What trigger sends the actual command which in turn tells the UPS hardware to start that countdown? The documentation is unclear on this finer point. Thanks, Jeff Bowman Fairbanks, Alaska -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20161005/89e29f9b/attachment.html>
On Wed, 5 Oct 2016, Jeff Bowman wrote:> I?m trying to better understand OffDelay and OnDelay: > http://networkupstools.org/docs/man/usbhid-ups.html#_extra_arguments > > My server requires ~3? minutes to shut itself down. Considering this I?m > comfortable setting OffDelay to 300 (five minutes). > > How does this work in conjunction with the UPS hardware? Does NUT > immediately send a command to the UPS to wait for 300 seconds and then > shut itself down, thereby allowing the server enough time to safely shut > itself down as well?Yes.> This is the only way I can think of that the arrangement can work. As > it?s naturally impossible for a turned-off computer to send any command > anywhere, an option for sending a ?take-this-now-but act-on-it-later? > command surely must exist.The command is "upsdrvctl shutdown".> I?ll be initiating my own shutdown sequence as a result of NOTIFYCMD > with a NOTIFYTYPE of ONBATT. My process will poll battery status for > five minutes (to reduce false positives) before finally deciding to send > individual shutdown commands to the server, NAS, other devices, etc. In > other words, I?m going to write my own upssched, suited specifically to > my platform and configuration needs. > > Given this configuration, at what point will the 300 seconds start > counting down? What trigger sends the actual command which in turn tells > the UPS hardware to start that countdown? The documentation is unclear > on this finer point.The 300 seconds start when the effect of "upsdrvctl shutdown" reaches the UPS hardware. See the diagrams at http://rogerprice.org/NUT.html#SYSD_RACE which assume an offdelay of 20 seconds. Roger
> > How does this work in conjunction with the UPS hardware? Does NUT > > immediately send a command to the UPS to wait for 300 seconds and then > > shut itself down, thereby allowing the server enough time to safely > > shut itself down as well? > > Yes.Very good, thank you.> The command is "upsdrvctl shutdown".That's what I thought, but I get this: Can't claim USB device [051d:0003]: libusb0-dll:err [claim_interface] could not claim interface 0, win error: The requested resource is in use. Driver failed to start (exit status=1) I don't know why it thinks I'm trying to start the driver.> The 300 seconds start when the effect of "upsdrvctl shutdown" reaches the UPS > hardware. See the diagrams at http://rogerprice.org/NUT.html#SYSD_RACE which > assume an offdelay of 20 seconds.That's what I was hoping for. Thank you for the helpful diagram. I also am not able to get the script specified in NOTIFYCMD to run when NOTIFYFLAG ONBATT EXEC is encountered. At this point, being pressed for time, it looks like I'm going to have to settle for writing a Windows Service that polls the output of [upsc ups at localhost ups.status] and responds accordingly. That should get me by for now.