> > 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.
On Oct 5, 2016, at 10:59 PM, Jeff Bowman wrote:> >> 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 "upsdrvctl shutdown" command is designed to be run late in the shutdown sequence, and has to be run after the rest of NUT (drivers, upsd, etc) has been stopped. It does, in fact, restart the driver with the "-k" option to kill the UPS rather than monitor it. (If I understand Roger's diagram, systemd invokes the "upsdrvctl shutdown" after most of the other processes have been stopped.) There are also ways to send shutdown commands to a running driver with "upscmd", which is useful for scenarios other than "shutdown and return when the power returns". http://networkupstools.org/docs/man/upscmd.html http://networkupstools.org/docs/user-manual.chunked/apcs02.html ("Instant commands")
On 10/5/2016 10:59 PM, Jeff Bowman wrote:> >>> 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) > [snip]I have found the shutdown delay to be quite elusive within the NUT realm. I have asked for the kind folk of this mailing list to post those UPS's which actually can implement the shutdown delay concept. I have not seen anything posted, here or on the website, to that effect. Nor have I seen any manner of documentation in the various UPS profiles that would suggest whether or not a specific UPS actually obeys and complies with the shutdown delay concept. I use NUT and I like NUT, and I sincerely appreciate all the effort put into making this project happen. Really. But at this point, the shutdown delay, as executed by a real, live, existing UPS, seems to be an unattainable fantasy to this mere, simple user. Something as critical as the shutdown delay should be so supremely documented that it is child's play. But it is not. It currently is wizardry, if it exists at all.
> The "upsdrvctl shutdown" command is designed to be run late in the shutdown > sequence, and has to be run after the rest of NUT (drivers, upsd, etc) has > been stopped. It does, in fact, restart the driver with the "-k" option to > kill the UPS rather than monitor it. (If I understand Roger's diagram, > systemd invokes the "upsdrvctl shutdown" after most of the other processes > have been stopped.)OK, I see.> There are also ways to send shutdown commands to a running driver with > "upscmd", which is useful for scenarios other than "shutdown and return when > the power returns". > > http://networkupstools.org/docs/man/upscmd.htmlI think that's going to be what I'm looking for. Thanks, Jeff Bowman Fairbanks, Alaska
On Wed, 5 Oct 2016, Mike wrote:> I have found the shutdown delay to be quite elusive within the NUT realm. > > I have asked for the kind folk of this mailing list to post those UPS's > which actually can implement the shutdown delay concept. I have not seen > anything posted, here or on the website, to that effect. > > Nor have I seen any manner of documentation in the various UPS profiles > that would suggest whether or not a specific UPS actually obeys and > complies with the shutdown delay concept.> Something as critical as the shutdown delay should be so supremely > documented that it is child's play. But it is not. It currently is > wizardry, if it exists at all.Hi Mike, The current NUT has evolved from a little documentation and a lot of experimenting. As an example of the lack of manufacturer's documentation, see Eaton's "POWER FAILURE SHUTDOWN TIMELINE" for their products. https://powerquality.eaton.com/Products-services/Power-Management/Software-Drivers/lansafe-help/LSHelp301.htm This page, from a leading UPS manufactuer fails to document the offdelay, which is hidden in the yellow bars labelled "System Shutdown". It does succeed in describing the Power-On Delay. It is not possible for NUT to take over the documentation of the idiosyncracies of each UPS. All NUT can say is "Try this with your UPS". However there is a need for a minimalist description of a working NUT setup. * A drawing and three sentences each to describe the NUT components (without upssched). * A working example of a set of configuration files for a single workstation which will shut down the workstation and the UPS when LB is reached. One sheet of A4. Or the electronic equivalent. We are looking for a volunteer to draft this sheet :-) Best Regards, Roger
> But at this point, the shutdown delay, as executed by a real, live, existing > UPS, seems to be an unattainable fantasy to this mere, simple user. > > > > Something as critical as the shutdown delay should be so supremely documented > that it is child's play. > > But it is not. It currently is wizardry, if it exists at all.I've been able to get delayed UPS shutdown working easily and reliably, using upscmd: upscmd -u username -p password ups load.off.delay 300 Note that this doesn't tell the UPS to turn back on when the power restores. Thanks, Jeff Bowman Fairbanks, Alaska