Roger, Following your guide, it now works great, shutting down the UPS after the system has shutdown. I went with the bash script method.
I have noticed, however, that the command to the UPS to do the delayed shutdown comes RIGHT as openSUSE is shutting down. While that is a good thing as far as timing and the potential race is concerned, I have seen it once where the UPS received the command to do the delayed shutdown, but *not* the command to do the delayed restart. While that's not a critical failure, it would be if the UPS doesn't get the delayed shutdown command instead. I'm wondering if the system (openSUSE ) died before that particular command could be sent over USB to the UPS. Sincerely, Robert G. Groner Software Engineer RTD Embedded Technologies, Inc. ISO 9001 and AS9100 Certified Ph: 814-234-8087 www.rtd.com -----Original Message----- From: Nut-upsuser [mailto:[email protected]] On Behalf Of Roger Price Sent: Saturday, May 23, 2015 6:02 AM To: nut-upsuser Mailing List Subject: Re: [Nut-upsuser] Are UPS shutdown commands automatically sent? On Fri, 22 May 2015, Rob Groner wrote: > So I'm pursuing the strategy of issuing the "upsdrvctl shutdown" > command script when the OS (Porteus, in this case) is shutting down. > I so far can't get it to do it, but I'm sure I'll overcome it, but I > realized something else might be a problem. > > Won't that script execute every time Linux is shutting down, including > rebooting? So, if I choose to reboot my system, I would most likely > see the UPS shutoff and then turn back on, somewhere in the middle of > my system booting back up. Hello Robert, The command /sbin/shutdown -r used to reboot the box is incompatible with a UPS which receives a delayed shutdown order. If you have offdelay = 30 in /etc/ups/ups.conf, then 30 seconds after the upsdrvctl shutdown, when the box has now probably restarted, the UPS will shutdown with total loss of power to the box. Not good. > I can think of a couple solutions: 1) Have the script verify that the > UPS is actually in a OB state before giving the shutdown command. > That should prevent unintended UPS power cycles when simply rebooting > the system. 2) Have the UPS itself not respect any "load.off.delay" or > similar commands when it is online. This adds complexity, and in a critical system component simplicity is a virtue. To reboot my box, I turn off the wall power and wait until I hear the "clunk" as the shutdown relay operates in the UPS. I then turn the wall power back on. > Looking over UPS documentation and various helps, it seems most people > would expect their UPS to turn the load off and then back on, even if > it has wall power the entire time. That would facilitate testing at a > minimum. So I'm guessing option #2 isn't a good one. If you have decided to use a UPS capable of shutting down and restarting when wall power comes back, then you have to respect the UPS cycle. You can't pretend it isn't there. Best regards, Roger _______________________________________________ Nut-upsuser mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser _______________________________________________ Nut-upsuser mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

