[CentOS] 2 questions re UPS management

Tue Mar 19 15:10:07 UTC 2013
m.roth at 5-cent.us <m.roth at 5-cent.us>

Fred Smith wrote:
> Hi, trying to figure out how the system manages UPS connections. On both
> Centos 5.9 and 6.4, merely plugging in a USB UPS device causes an icon
> to appear in the top panel, and (at least on 5.9, haven't yet tested
> this in 6.4) when the UPS suffers a power failure the system notices
> and after a bit does a clean shutdown.

Interesting.... I haven't observed this behavior; certainly not on
headless servers, though most are on UPSes; nor, when I had a working UPS
for my workstation, have I seen it. Are you running gnome or KDE?
>
> All this without installing ANYTHING extra.
>
You mean, like apcupsd?

> question #1:
> in 5.9 there are two entries in /etc/inittab, one for power fail and
> the other for power restoration. The default setting for the powerfail
> entry has it doing a shutdown in 2 minutes.
<snip>
> message (when power fails) about the line being too long. So, I created
> a shellscript that runs both the command to tell XP to go down, followed
<snip>
> When I run this script from the commandline it works just fine. but when
> I turn off input power to the UPS it starts the  XP shutdown then within
> without waiting the specified length of time, initiates the shutdown
> of Linux. Once the shutdown is done, the UPS powers off, thereby killing
> the not-yet-shutdown windoze box.

Thinking about this as I write, I'd guess that it expects the machine
*receiving* the shutdown to respect the five minute wait. What you might
want to do is a sleep 300 before sending the command.
<snip>

         mark