Linux Utility to Suspend Laptop until AC power connected?

0

I run a home server on a Laptop, and recently I ran into an issue where we had a storm and the power went out. The laptop I use as a home server does not have a "Wake on AC Power" function built into the bios, so the laptop died and did not turn back on until I turned it on manually. For the time being (Until I eventually purchase better hardware to use as a home server), I was wondering if I could maximize battery time when the power shuts off by making the computer suspend when on battery power, and then resume when AC power is presented at a later time. Does a utility like this exist, or can I fabricate something on my own easily?

Huntereb

Posted 2016-06-18T01:43:53.563

Reputation: 43

Answers

0

I guess I'll just post my solution. I ended up buying new hardware that has an auto-power-on feature within the bios.

My alternative solution was to use "rtcwake" to suspend the computer for maybe an hour or so, and upon waking up, check if we have AC power available. If not, sleep again. This is really nasty looking, though.

Huntereb

Posted 2016-06-18T01:43:53.563

Reputation: 43