[Nut-upsuser] FSD sequence: Waiting for bigger and slower clients before cutting power

Dan Langille dan at langille.org
Fri Oct 27 16:06:50 BST 2023


On Fri, Oct 27, 2023, at 10:25 AM, Magnus Holmgren wrote:
> Hi, and thanks for this great piece of free software! I've been meaning to 
> sort this out for some time, but we don't get power outages that often, 
> fortunately...
>
> So, correct me if I'm wrong, but from the documentation at https://
> networkupstools.org/docs/user-manual.chunked/
> Configuration_notes.html#UPS_shutdown, and also reading upsmon.c, when a UPS 
> goes OB LB (assuming we have a single UPS connected to a primary and supplying 
> power to the primary and some number of secondaries), the primary notifies the 
> secondaries, the secondaries wait for FINALDELAY and then execute SHUTDOWNCMD 
> immediately followed by exiting, thereby disconnecting from the primary, and 
> the primary, after seeing all secondaries disconnect, proceed with its 
> shutdown (only waiting for FINALDELAY), which ends with telling the UPS to cut 
> the power (without delay too, right?).
>
> Again, correct me if I'm wrong, Is it only I who find this a bit flawed? I 
> would like for the secondaries to stay connected until they shut down. We have 
> a server with a bunch of virtual machines on, and they can take a couple of 
> minutes to shut down. Otherwise the primary can easily cut the power 
> prematurely. Avoiding this, it seems, could pretty easily be accomplished by 
> having upsmon wait, perhaps in a separate loop, for the INT/TERM/QUIT signal 
> (it would still be necessary to configure the service manager such that upsmon 
> is terminated as late as possible). The primary could start shutting down its 
> services in the meantime, but upsmon would hold the poweroff until the 
> secondaries have disconnected (or HOSTSYNC expires).

I'm not talking directly to your point, however it is a related area.

What I want to do, and have not yet:

* shutdown the primary servers first (i.e. the two Dell R730 in the basement)
* leave the gateway device (small box, very little power and the switches running)
* when battery gets down a bit farther, shutdown the rest of the gear

Power outages aren't common for me, so I might be able to keep my home internet running for another 40 minutes or so, which might be a good thing.

-- 
  Dan Langille
  dan at langille.org



More information about the Nut-upsuser mailing list