Rob Groner
2015-May-27 14:31 UTC
[Nut-upsuser] Are UPS shutdown commands automatically sent?
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:nut-upsuser-bounces+rgroner=rtd.com at lists.alioth.debian.org] 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 Nut-upsuser at lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
Roger Price
2015-May-27 17:36 UTC
[Nut-upsuser] Are UPS shutdown commands automatically sent?
On Wed, 27 May 2015, Rob Groner wrote:> 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.Hello Robert, This is surprizing. To the best of my knowledge the delayed-shutdown and the delayed-restart commands to the UPS are one single command. What is the symptom that the UPS has not received "delayed-restart"? Is it that the UPS does not restart? This could be due to something else. Best Regards, Roger
Rob Groner
2015-May-27 18:19 UTC
[Nut-upsuser] Are UPS shutdown commands automatically sent?
Roger, The UPS I'm connected to is one we're actually developing, and I've authored the firmware for it. I have a serial connection to it so I can output messages of interest, and one of those is when the UPS detects that the user has requested the delayed shutdown and restart. So far, every time I've done the upsdrvctl shutdown, I've seen both requests on the screen. But this last time, I only got the request for the delayed shutdown. It is certainly possible I'm doing something wrong in the firmware itself. If it really is just one USB Set Report being sent to the UPS, then that would be almost impossible that just the delayed shutdown got through. I haven't seen it again since then. I'll try some more times and see if I can find something repeatable about it. 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:nut-upsuser-bounces+rgroner=rtd.com at lists.alioth.debian.org] On Behalf Of Roger Price Sent: Wednesday, May 27, 2015 1:37 PM To: nut-upsuser Mailing List Subject: Re: [Nut-upsuser] Are UPS shutdown commands automatically sent? On Wed, 27 May 2015, Rob Groner wrote:> 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.Hello Robert, This is surprizing. To the best of my knowledge the delayed-shutdown and the delayed-restart commands to the UPS are one single command. What is the symptom that the UPS has not received "delayed-restart"? Is it that the UPS does not restart? This could be due to something else. Best Regards, Roger _______________________________________________ Nut-upsuser mailing list Nut-upsuser at lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser