<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 1/1/20 9:56 PM, David White wrote:<br>
</div>
<blockquote type="cite"
cite="mid:0d2be747-0f24-9c04-fa53-663e9f37d871@yahoo.com">
<br>
<br>
On 1/1/2020 11:49 AM, David White wrote:
<br>
<blockquote type="cite">
<br>
Hi Roger and, as always, thanks!
<br>
<br>
I really do not want to wait very long before shutting down
things on
<br>
this UPS. What I think I am doing (or at least trying to do) is
to
<br>
execute a script on the host machine when the UPS is detected by
NUT to
<br>
be on battery power.
<br>
<br>
That script sleeps 20 seconds to ensure that this was not just a
power
<br>
blip (which happens here often) but a real power outage. After
20
<br>
seconds, the script checks the UPS status via upsc and if it is
no
<br>
longer OB, power is deemed restored and the script exits.
<br>
<br>
If, after 20 seconds, UPS status remains OB then the event is
deemed a
<br>
true power outage and I want to shut down what I can cleanly. To
do
<br>
this, the script issues remote shutdown commands to a set of
network
<br>
connected devices also living on this UPS (but sadly not able to
run
<br>
NUT). As its final step, it issues a command to shut the host
machine down.
<br>
<br>
It seems from what you say above, I need to issue
"/sbin/upsdrvctl
<br>
shutdown" in there somewhere - obviously before I shut the host
machine
<br>
down. I will have to test this to see exactly what that command
does.
<br>
When run w/out arguments, the usage says shutdown shuts down UPS
<br>
drivers. I am not clear if this means that the UPS itself will
be
<br>
powered off or if simply NUT is shutdown.
<br>
<br>
Thanks
<br>
<br>
<br>
</blockquote>
Well, I just tried "/sbin/upsdrvctl shutdown" and while I see some
output and a message shutting down in 30 seconds, nothing happens
to the host machine or the UPS. Hmmm. <br>
</blockquote>
<p>that command only stops the drivers. generally speaking,
upsdrvctl operates <b>only</b> on the drivers.<br>
</p>
<p>pi@pi:~# upsdrvctl --help<br>
Network UPS Tools - UPS driver controller 2.7.4<br>
upsdrvctl: invalid option -- '-'<br>
Starts and stops UPS drivers via ups.conf.<br>
<br>
usage: upsdrvctl [OPTIONS] (start | stop | shutdown) [<ups>]<br>
<br>
-h display this help<br>
-r <path> drivers will chroot to <path><br>
-t testing mode - prints actions without
doing them<br>
-u <user> drivers started will switch from
root to <user><br>
-D raise debugging level<br>
start start all UPS drivers in ups.conf<br>
start <ups> only start driver for UPS
<ups><br>
stop stop all UPS drivers in ups.conf<br>
stop <ups> only stop driver for UPS <ups><br>
<b> shutdown shutdown all UPS drivers in ups.conf</b><br>
shutdown <ups> only shutdown UPS <ups><br>
<br>
</p>
</body>
</html>