[nut-Bugs][310987] Docs incorrect on slave shutdown synchronization

nut-bugs at alioth.debian.org nut-bugs at alioth.debian.org
Mon Aug 4 13:25:27 UTC 2008


Bugs item #310987, was opened at 2008-08-03 17:07
>Status: Closed
Priority: 1
Submitted By: Jeff Dairiki (dairiki-guest)
Assigned to: Arjen de Korte (adkorte-guest)
Summary: Docs incorrect on slave shutdown synchronization 
Category: None
Group: None
>Resolution: Fixed


Initial Comment:
The docs state that, when a slave upsmon sees an FSD, it runs SHUTDOWNCMD, and then finally disconnects "when killed by init".  (See, e.g., step 4 in http://eu1.networkupstools.org/doc/2.2.0/shutdown.html.)

This is incorrect.   The slave upsmon exits immediately after it runs SHUTDOWNCMD.

Either the docs or upsmon should be fixed so that they agree.

I would much prefer that upsmon be changed to behave as the docs describe.
This would make it possible for the master to wait for all slaves to shutdown --- this would be particularly useful when some of the slaves may have lengthy shutdown sequences (e.g. stopping several xen domains.)

Thank you all for your work on NUT!



----------------------------------------------------------------------

>Comment By: Arjen de Korte (adkorte-guest)
Date: 2008-08-04 15:25

Message:
I can confirm that this is a documentation bug. A upsmon slave will indeed logout from the server (and exit) right after sending the SHUTDOWNCMD. It has been like this at least since nut-2.0.1 came out more than three years ago and I doubt it was ever the way as documented (not many people read the docs apparently, kudos to Jeff here). For this reason alone, I don't think changing the behavior of the upsmon client is a good idea.

I'm not so sure that changing the behaviour of upsmon will help in solving this in the first place. Since upsmon requires quite a number of services to run, it will typically be among the first services to stop when shutting down. You might indeed gain some additional control here, but not much and it is certainly not something you can rely upon.

The problem is that the master expects that slaves will shutdown and logout immediately after seeing the 'FSD' flag (see also 'man 5 upsmon.conf') and therefor, we can live with a fairly short HOSTSYNC time (default 15 seconds). To be of any use, the proposed change would require a much longer HOSTSYNC period, so that the master would not give up too soon on slaves that have not yet reached the point where init kills upsmon. I don't think it is safe for the master to wait much longer than that (the UPS might run out of juice in the mean time).

What you basically need (and what most UPSes support) is a shutdown with delay. This allows all connected systems (including the master) to initiate the shutdown sequence at the same time, while still allowing slower systems to go down cleanly before power is cut. If your UPS happens to be among the few models that doesn't support shutdown with delay, specifying FINALDELAY on the master might also do the job.

----------------------------------------------------------------------

You can respond by visiting: 
http://alioth.debian.org/tracker/?func=detail&atid=411542&aid=310987&group_id=30602



More information about the NUT-tracker mailing list