[Nut-upsuser] UPS Shutdown

Roger Price roger at rogerprice.org
Thu Oct 6 02:17:55 UTC 2016


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


More information about the Nut-upsuser mailing list