[CentOS] 2 questions re UPS management

Gordon Messmer

yinyang at eburg.com
Wed Mar 20 08:59:48 UTC 2013


On 03/19/2013 09:09 PM, Fred Smith wrote:
> On Tue, Mar 19, 2013 at 03:36:45PM -0700, Gordon Messmer wrote:
>> If you run the script manually, you should expect to see the Windows PC
>> shut down, then the Linux machine after 5 minutes, and the UPS should
>> shut down with the Linux host.  Is that what happens?
>
> Yes. exactly that.

OK.

> I dunno what a "master port" is,... there's only one place to connect
> the USB cable to the UPS.

The master port is a power port on the UPS.  If configured to do so, the 
UPS will shut off all power ports when the device on the master port 
shuts off.

If you're actually using a master port, the Windows host and all other 
devices would be immediately turned off every time you power down the 
Linux host.  That's one way to determine whether or not you are.

However, if you're not, then I'm not sure why the UPS would ever turn 
off.  I'm almost completely certain that GNOME's power management cannot 
power off the UPS when the system halts.  That feature is common to 
business class UPS management software, but not GNOME.

>> Try turning off the Windows host and then pulling the UPS off of line
>> power.  See how everything behaves when only the Linux host is running
>> on the UPS.

That's still a useful test, as is just shutting down the Linux host to 
see if the other equipment is turned off when the Linux host shuts off.

> so my puzzle remains: why does shutdown not honor the "+5" when it's
> part of a separate script, but does when it's not?

My first guess would be that either the powerfail script is being 
executed as part of a shutdown, or that the powerfail script is being 
executed in addition to a shutdown.

>> If you want the systems to shut down whether or not you're logged in,
>> you'd need to install NUT and configure it to manage the UPS, and
>> configure GNOME to not do so.
>
> You think this mechanism only works when logged in? (I have no idea,
> I'm not doubting you, it's simply a thought I hadn't had--yet).

I don't use GNOME power management, so I can't say that I've tested it. 
  However, everything that I've read indicates that it only functions in 
the user shell.  gdm's session may not run the power management code, or 
may not be configured to do anything on a low power state.

> the C6 system is a personal desktop, at home, and it too is logged in
> most of the time. Last time I looked at nut, I found too many things
> I had to know in order to configure it that I didn't know, like it wasn't
> clear which nut device driver was correct for the tripplite UPS I had
> at the time, and some of the configurations (as far as I recall,... it's
> been several years) depended on which device it was. So after messing
> with it a while, and it not working, I just gave it up.

For USB attached UPSs, it's pretty straightforward.

nut.conf:
MODE=standalone

ups.conf:
[apc]
         driver = usbhid-ups
         port = auto

upsd.users:
... follow the examples to create an admin user, set passwords.  I 
frequently use "uuidgen" to create passwords for these.

[admin]
         password = @PASSWORD@
         allowfrom = localhost
         actions = SET
         instcmds = ALL
         upsmon master


upsmon.conf:
MONITOR apc at localhost 1 admin @PSAASWORD@ master





More information about the CentOS mailing list