[Nut-upsuser] Semantic relationships between shudown.stayoff, shutdown.return, and ups.start.auto

Arnaud Quette aquette.dev at gmail.com
Tue Jan 17 15:36:25 UTC 2012

Hi Rich,

2012/1/15 Rich Wrenn <rwrenn at ddn.com>:
> Charles,
> Thanks for your reply, however..
>>> Nut-names.txt states that
>>> 1.       ups.start.auto controls whether the UPS starts when mains is (re)applied.
>>> 2.       shutdown.stayoff causes "turn off the load possibly after a delay and remain even if power returns".
>>> 3.       shutdown.return causes "turn off the load possibly after a delay and return when power is back".
>>> 1 seems to conflict with 2 and 3.  That is, 2 implies that ups.start.auto=no and 3 implies that ups.start.auto=yes.
>> My understanding of the "ups.start.auto" setting is that it only applies when an explicit shutdown command has not been > given (and therefore would be overridden by one of the shutdown.* commands, if NUT is configured to manage the shutdown > process).
> That would be reasonable.  If this is the intent then I suggest that that be said in the description of ups.start.auto in nut_names.txt.

indeed, though currently, only Eaton exposes this data (USB/HID, SHUT
and SNMP), since it's part of the legacy from MGE...
which also explains why it's not present on the Powerware side (XCP)

>> That said, I'll defer to someone who knows the specifics of the Eaton hardware for information on how it should work.  > The UPS firmware has a lot of leeway in how the commands and settings are interpreted.
> My experience so far with the Evolution 1550 is that shutdown.stayoff only works correctly if ups.start.auto=no and that shutdown.return only works correctly if ups.start.auto=yes.  Given that, shouldn't the NUT driver for this UPS set ups.start.auto as part of these shutdown commands?

I confirm what you already saw: ups.start.auto has an impact on the
shutdown functions.
For the sake of coherence, I've prepared the attached patch, which
will check for the right ups.start.auto before applying the shutdown
This applies to both usbhid-ups and newmge-shut, and will not impact
any other devices but Eaton.

I'm currently not able to commit it, since there is an outage on
Alioth (hosting our SCM).

Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/
-------------- next part --------------
Index: docs/nut-names.txt
--- docs/nut-names.txt	(révision 3393)
+++ docs/nut-names.txt	(copie de travail)
@@ -110,6 +110,10 @@
                           (enabled or disabled)        | yes
+NOTE: When present, the value of *ups.start.auto* has an impact on shutdown.*
+commands. For the sake of coherence, shutdown commands will set *ups.start.auto*
+to the right value before issuing the command. Ie, shutdown.stayoff will first
+set *ups.start.auto* to *yes*, while shutdown.return will set it to *no*.
 input: Incoming line/power information
Index: drivers/usbhid-ups.c
--- drivers/usbhid-ups.c	(révision 3393)
+++ drivers/usbhid-ups.c	(copie de travail)
@@ -556,6 +556,11 @@
 		if (!strcasecmp(cmdname, "shutdown.return")) {
 			int	ret;
+			/* Ensure "ups.start.auto" is set to "yes", if supported */
+			if (dstate_getinfo("ups.start.auto")) {
+				setvar("ups.start.auto", "yes");
+			}
 			ret = instcmd("load.on.delay", dstate_getinfo("ups.delay.start"));
 			if (ret != STAT_INSTCMD_HANDLED) {
 				return ret;
@@ -567,6 +572,11 @@
 		if (!strcasecmp(cmdname, "shutdown.stayoff")) {
 			int	ret;
+			/* Ensure "ups.start.auto" is set to "no", if supported */
+			if (dstate_getinfo("ups.start.auto")) {
+				setvar("ups.start.auto", "no");
+			}
 			ret = instcmd("load.on.delay", "-1");
 			if (ret != STAT_INSTCMD_HANDLED) {
 				return ret;

More information about the Nut-upsuser mailing list