[Nut-upsuser] UPS Shutdown

Charles Lepple
Thu, 06 Oct 2016 03:21:49 -0000

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")