Re: [Apcupsd-users] Disable UPS shutdown after the the system is powered down.
Brought to you by:
adk0212
|
From: mudtoe <e2...@ho...> - 2010-03-22 03:55:33
|
Kris Jordan-2 wrote:
>
>
>
> 30 seconds is probably not enough, especially with VMware server running
> on there.
>
> Disabling killpower, 02/19/2010, from me, edited
>
> Here's a couple methods:
>
> 1. Edit apccontrol:
>
> case "$1" in
> killpower)
> # echo "Apccontrol doing: ${APCUPSD} --killpower on UPS ${2}"
> # sleep 10
> # ${APCUPSD} --killpower
> # echo "Apccontrol has done: ${APCUPSD} --killpower on UPS ${2}" |
> ${WALL}
> ;;
>
> Comment out those 4 lines (like above).
>
> 2. Edit your OS shutdown script preventing it from running apccontrol
> killpower. Try grep -r killpower /etc/rc.d
>
>
>
30 seconds is enough once the shutdown script is finished because I put code
directly in the shutdown script to gracefully shutdown the VMs, and then
after 2 1/2 minutes just power them off, all of which happens before the
script issues the actual "shutdown" command. That means that the shutdown
script runs a bit over 2 1/2 minutes, which means I've got the script
scheduled to run at the 4 minute remaining mark, but once that's done VMWare
Server doesn't appear to add much to the actual shutdown since no VMs are
still running at that point.
I did use your information from a previous post and commented out the
killpower lines in the apccontrol file, coupled with "shutdown -P now" in
the shutdown script. The laptop does shutdown and power off now, but when I
restart it, it still goes through the 5 minutes file verification. I'm
beginning to wonder if this problem is not related to apcupsd, but has
something to do with Ubuntu 9.10 64 bit itself. I had to go home, so I
can't play with this any longer until I go back there, which may be quite a
while, but I've left it in a situation where in a power failure the VMs can
be shutdown and the laptop itself will shutdown in a way that I can reliably
restart it via magic packet once the power comes back up, so that's a big
improvement.
Prior to installing apcupsd I had to have the two VMs that I left running
all the time setup with dummy snapshots so that if the power failed and the
laptop was powered down without warning, the VMs would not run the risk of
having their VM hard disk files corrupted. That only worked because the
VMs were communication services type applications (e.g. OpenVPN proxy
server) and wern't recording database changes or anything like that, so that
if the snapshot of the hard disk changes were corrupted by the power failure
I could simply discard the snapshot, create a new one, and go on. Only
issue was that if I was actually going to apply patches or software changes
to a VM I had to remember to commit the snapshot to the permanent hard disk
file, and then create a new dummy snapshot so as to not lose the changes if
the snapshot got corrupted.
One last question, and this applies only tangentially to what we are talking
about here, is that the only fly in the ointment in all of this is that I
have no easy way to know if the power has come back on, because if nothing
else is using the UPS (laptop powered off, and other devices not running to
start with) it may take a long time for it to completely run down.
Therefore I potentially run the risk of starting the laptop back up via
magic packet only to have the UPS run out of juice during the startup
because the power never came back on. I have an idea on this one because I
have a second UPS in another room of the vacation home that runs the router
and cable modem (thunderstorms cause so many surges and sags in south
Florida that you have to have a UPS on just about everything). Because of
the logistics about where the cable wall jack was I couldn't have the router
or cable modem in the same area as the rest of the equipment, so I had to
have a second UPS.
Fortunately this gives me an opportunity because also sitting in the same
area, and served by the same second UPS, is one of those Belkin gadgets that
bridges a USB connection over TCP/IP. Before I left I connected the second
UPS to the Belkin unit, and I can now in theory access the second UPS via
it's USB connection, directly from a VM running in my primary residence,
even though that VM isn't being powered from that UPS. My question is can I
setup apcupsd on a windows OS to report an outage, but not shutdown the OS
when the power runs out? That way, as long as the router and cable modem
are still running in the vacation home I can query the second UPS from a VM
at my primary residence and see if the power is on or not. Obviously if the
connection is down, then I have to assume that the power is out and the
battery is discharged, but if the connection is up I'll have a way to know
if it's back up after the power came on, or if it's still up but on battery,
in which case I wouldn't want to restart the laptop. The trick would be
that I only want apcupsd to report, and in fact all I really would need is
the windows equivalent of the "apcaccess status" command to do a real time
query of the UPS to see if it's on AC power.
mudtoe
mudtoe
--
View this message in context: http://old.nabble.com/Disable-UPS-shutdown-after-the-the-system-is-powered-down.-tp27660047p27982211.html
Sent from the apcupsd-users mailing list archive at Nabble.com.
|