I have used apcupsd under ubuntu to power off my machine when AC power is lost via serial.

Is there any way let the UPS to wake up already powered off machine when AC power is back? I have tried to enabled everything in BIOS that corresponding to wake up by ring, still no luck.


This should be a standard feature of BIOS, and handled easily by apcupsd.

You are looking in BIOS for power-auto-return, power-return, OR after-power-loss. This can be enabled, disabled, or (for more recent BIOS) last-state. The 'last-state' option means: did you manually leave the machine on OR off, using the power switch.

I have used an APC UPS, with apcupsd and USB connection, to do precisely what you are trying to do.

The UPS givith and the UPS taketh away. (but in reverse):

When the UPS is low on battery, it halts power to the machine. When it again has mains-power, it returns power to the machine. From the machines viewpoint, the power was removed and restored, BUT outside its control. It should just follow the BIOS setting for: 'after power loss".

  • But that would defeat the purpose of a UPS. I mean if I can't gracefully shutdown while the UPS is connected I'm exposed to the same risks as in a power outage e.g time for the raid controller to dump DMA cache.
    – dantebarba
    Jul 10 '19 at 15:10
  • Not sure what you are saying .. You can 'gracefully shutdown' while the UPS is connected. Are you asking about automated behaviour?
    – david6
    Jul 12 '19 at 10:30
  • exactly. If you have a server or just a NAS in your home office you won't be able to be present all the time to shut it down whenever the power goes out.
    – dantebarba
    Jul 12 '19 at 13:52
  • Maybe I just didn't understand what you were explaining. But it seems to me that using apcupsd to shutdown when the UPS is on battery wont work. The BIOS feature "power up to last state after power loss" will only work if the last recorded state of the BIOS is "power up" and that is not going to happen if apcupsd shuts the computer down beforehand.
    – dantebarba
    Jul 12 '19 at 14:01

You could also probably use a Raspberry Pi not connected to UPS which wakes the server via WoL or IPMI when power comes back and RPi boots.


I apologize for what may be a complex answer.

I think the issue would be that the computer is receiving power from the UPS until it runs out of battery... thus when power comes back on there is no 'change in state'. If the UPS were to have run out of power I believe the server settings for automatically power on would work. If you have a way to send a magic packet then wake on lan might work.

see link: http://www.linksysinfo.org/forums/showthread.php?t=65772

  • 1
    You could use an ALIX box with NanoBSD (or pfSense) to connect to a UPS via serial and then have it send a WoL packet. This would avoid requiring a rather expensive investment in a network UPS.
    – Steve-o
    Sep 9 '11 at 8:18

I had a similar issue and I resolved it by connecting a Wifi AP with DD-WRT directly to mains.

In a situation where there is power loss and the server shuts down, but the power return so the server does not see the change in mains state the starting up Wifi AP sends a few WOL (wake-on-lan) packets throughout 5 minutes to make sure the packet will be received (in case the server is still shutting down, while power already returned).

The second scenario when power return after the UPS has run out of batteries just requires a BIOS setting to power on after power loss.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.