Citeren David Varley <davidavar...@gmail.com>:

Arjen, now I'm a bit confused. In your script you are saying to shut down
nut before issuing the upsdrvctl command to tell the UPS to start a delayed
shutdown.

Yes.

But as shutting down nut causes the usbhid-ups driver to exit, I
thought that would prevent the command being sent to the UPS?

There are two ways to make a UPS kill it's output:

- send a command to a backgrounded driver through upsd to tell it to shutdown (through the web interface or upscmd for instance) - starting the driver with '-k' flag on the command line (this is the method that upsdrvctl shutdown uses, see 'man 8 nutupsdrv')

I know that if
I just have the upsdrvctl shutdown command without telling the nut service
to exit, the UPS shuts down after the 60 second delay.

There will be two drivers fighting for control over the same UPS. This will not work at all for serial devices (since the port will be locked by the backgrounded driver). In case of USB connected ones, you might be lucky that the driver started with the '-k' flag will have control over the USB interface long enough to send the shutdown command, but this is not reliable. You should not take your chances here.

I can understand
adding the delay after giving the shutdown command and before stopping the
services, but not the other way around. What am I missing here?

You missed reading the docs/suspend-to-disk.txt file, where it is explained how you should set this up. If you want to know the details about this, start reading the remainder of the documents in docs/ before asking.

Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


_______________________________________________
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Reply via email to