You are not logged in.

#1 2014-01-26 06:17:25

fukin_jim
Member
Registered: 2013-02-27
Posts: 20

[Solved] Shutdown server safely in the event of power failure

I'm thinking of setting up an old laptop with a dead battery as a server.  One of this issues I'm wondering about is if there is a way to have it safely shut down in the event of a power outage, so that there is no potential damage.  I'm thinking that there must be a way to run a script that will detect if it is running on battery power (this device has about a 5 minute battery life, and I have no reason to justify replacing the battery as I have 2 other perfectly operational computers) and perform a system shutdown.
However that being said, my scripting abilities are in the N00b range, and I'm not really sure where to start with this.  Any advice, would be greatly appreciated!

Last edited by fukin_jim (2014-01-26 07:37:57)

Offline

#2 2014-01-26 06:51:08

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Shutdown server safely in the event of power failure

This seems appropriate for your use case: https://wiki.archlinux.org/index.php/Acpid

Offline

#3 2014-01-26 07:37:14

fukin_jim
Member
Registered: 2013-02-27
Posts: 20

Re: [Solved] Shutdown server safely in the event of power failure

Thank you, I was thinking that that might be a good starting place, but I wasn't too sure.  This project is weeks down the road, so I won't bother to update.

Offline

#4 2014-01-26 15:59:28

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Shutdown server safely in the event of power failure

Why wouldn't you update?  Part of being an Arch Linux user is keeping up with the fast paced bleeding edge repos.  Waiting a week or two typically won't hurt, but getting in the habit of leaving your machine static like that can potentially come back and bite you.  If you just stay on top of any *.pacnew files, you should be well aware of any configuration changes that might need your attention.

If you want to have a machine that you can not update for large swaths of time and more or less not think about, you might consider debian.

Offline

#5 2014-02-11 20:57:07

fukin_jim
Member
Registered: 2013-02-27
Posts: 20

Re: [Solved] Shutdown server safely in the event of power failure

I meant updating this thread.  I haven't even set up the machine yet...

Offline

#6 2014-02-12 00:24:03

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Shutdown server safely in the event of power failure

fukin_jim wrote:

I meant updating this thread.  I haven't even set up the machine yet...

Okay.  Now that statement makes a whole crap load more sense.  smile

Offline

Board footer

Powered by FluxBB