Tricking out Computer/UPS.

I've got a linux based PC that I use for home automation. It's connected to a UPS that actually had Linux based control software.

So, it's configured, that upon a power failure, the linux box shuts itself down (nice and orderly). With the delays, and times involved, I'm left with about 35% of the UPS battery.

The PC is set to "auto boot" when power comes back on, but the catch 22, is that the UPS still has some juice (that could take a long time to expire), so the PC never actually sees the power go off.

Therefore, the PC won't boot when the power is restored. I think I figured a way to "trick it out", but before I build anything, I thought someone might have solved this already....

What I'm thinking is a box that plugs into the "non backed up" AC, that also connects to a USB port on the PC. The USB will ONLY be used for the 5 volts. If the "non backed up" AC is on, but the 5 volt USB is off, I'd use a relay to break the power from the UPS to the PC for a few seconds. The PC would see the loss of power, and then see it come back, and the boot would start. I'd probably throw in a PIC so I could use timers, etc. As I have a USB cable running to the UPS, and the UPS has "surge only" outlets.

Another option would be to use the "surge only outlet with a timer, that disconnects the UPS/PC power say 5 minutes after the "expected shutdown" of the PC, and doesn't reconnect it until the "surge only" outlet again has power.

You can contact me off list at jmiller at usandthem dot com. If there's a better group to post this two, let me know, or feel free to repost it.

Reply to
J Miller
Loading thread data ...

In article , reply@here (J Miller) writes: | I've got a linux based PC that I use for home automation. It's | connected to a UPS that actually had Linux based control software. | | So, it's configured, that upon a power failure, the linux box shuts | itself down (nice and orderly). With the delays, and times involved, | I'm left with about 35% of the UPS battery. | | The PC is set to "auto boot" when power comes back on, but the catch 22, | is that the UPS still has some juice (that could take a long time to | expire), so the PC never actually sees the power go off.

Usually you tell the UPS to shut off until power is restored as part of your PC's shutdown process. The UPS will typically provide a delay so the PC will have time to finish its shutdown before it loses power, though it is possible to get the system into a clean state with r/o file system and still be talking to the UPS.

What kind of UPS are you using? The APC SmartUPS series has some quirks that make the above slightly tricky to implement...

Dan Lanciani ddl@danlan.*com

Reply to
Dan Lanciani

I recall this hole when I was using APC SmartUPS over 10 years ago. (I'm somewhat surpised to learn they haven't fixed in in this time.) Power would fail. When UPS got down to 10%, it would tell the server to shutdown. If power came back on at this point, the UPS would abandon its own shutdown, but had no way to bring the OS back up.

I was running Solaris, and that normally doesn't care if you just pull the plug on it. So instead of having the UPS shutdown the system, I just had it shutdown any apps which did care about pulling the plug (e.g. databases). Then it would just pull the plug on the OS if the battery went flat, which didn't matter in the case of an idle Solaris system. OTOH, if the mains recovered at this point, the OS carried on running, and you can detect the mains recovered from the UPS in order to start up any apps you shutdown, or at least you can get into the system remotely and start them up by hand. One refinement -- wait a couple of minutes after mains recovers before starting apps -- there seems to be a much higher chance of another power cut within a few minutes of power being restored.

Reply to
Andrew Gabriel

It's Cyberpowr CP685AVR. No option to shut off the power I can find. (it was

Reply to
J Miller

In article , reply@here (J Miller) writes: | Dan Lanciani wrote: | > In article , reply@here (J Miller) writes: | > | I've got a linux based PC that I use for home automation. It's | > | connected to a UPS that actually had Linux based control software. | > | | > | So, it's configured, that upon a power failure, the linux box shuts | > | itself down (nice and orderly). With the delays, and times involved, | > | I'm left with about 35% of the UPS battery. | > | | > | The PC is set to "auto boot" when power comes back on, but the catch 22, | > | is that the UPS still has some juice (that could take a long time to | > | expire), so the PC never actually sees the power go off. | > | > Usually you tell the UPS to shut off until power is restored as part | > of your PC's shutdown process. The UPS will typically provide a delay | > so the PC will have time to finish its shutdown before it loses power, | > though it is possible to get the system into a clean state with r/o | > file system and still be talking to the UPS. | > | > What kind of UPS are you using? The APC SmartUPS series has some quirks | > that make the above slightly tricky to implement... | > | > Dan Lanciani | > ddl@danlan.*com | It's Cyberpowr CP685AVR. No option to shut off the power I can find. | (it was

Reply to
Dan Lanciani

Yup... after a few phone calls, Cyperpower verified that the UPS does support this, and acknowleged that they had a bug in their Linux software... They couldn't even guess when it would be fixed, and one of the folks suggested using NUT.

Downloaded it and got it built and installed. It's shutting down just fine... BUT.. for the life of me, I cant get the command for shutting off the UPS to work at shutdown (if I call the script by hand, it works.)

I'm on FC3, and putting a kill script (K99ups is what it's called) in rc1.d.

Dan Lanciani wrote:

Reply to
J Miller

Reply to
J Miller

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.