SOLVED - Shutdown* laptop when mains is disconnected

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

SOLVED - Shutdown* laptop when mains is disconnected

Postby FranBlakes » Sat Oct 13, 2012 9:28 am

I'm using Ubuntu 10.04 LTS on an ageing laptop.

The battery only lasts 1min 40sec appx.
When the battery dies, the BIOS resets :(

So is there a way that when mains is disconnected eg power failure, the laptop would hibernate or shutdown. Hibernate takes 45secs.

Any help would be appreciated :)
Last edited by FranBlakes on Sat Oct 13, 2012 10:36 pm, edited 1 time in total.
Ubuntu 10.04.4 LTS!
User avatar
FranBlakes
 
Posts: 96
Joined: Wed Dec 01, 2010 9:16 pm
Location: Worcs.

Postby nelz » Sat Oct 13, 2012 9:08 pm

Try putting this in /etc/acpi/events/unplugged

Code: Select all
event=ac_adapter.*0$
action=/usr/sbin/hibernate


The first line matches on an ACPI event sent when the AC adaptor is unplugged, the action should be set to whatever command your system needs to initiate hibernation.

This is only a very temporary fix though, soon your battery will last even less time, or none at all, as mine recently started doing.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8520
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby FranBlakes » Sat Oct 13, 2012 10:36 pm

Thanks nelz!

The laptop has always plugged in, which they say damages the battery.

The command I had to use, just in case any 10.04 users need it is
Code: Select all
pm-hibernate
Ubuntu 10.04.4 LTS!
User avatar
FranBlakes
 
Posts: 96
Joined: Wed Dec 01, 2010 9:16 pm
Location: Worcs.

Postby Ram » Sun Oct 14, 2012 9:01 pm

Take the battery out if always on the mains.

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
User avatar
Ram
LXF regular
 
Posts: 1679
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough

Postby nelz » Sun Oct 14, 2012 11:28 pm

Then he loses the 100 seconds of grace that the battery still gives him. A laptop battery acts as a UPS when running off the mains.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8520
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby Ram » Mon Oct 15, 2012 7:57 am

I was thinking more on the lines of saving the life of the battery.

For my works business laptops they advice not have them connected permanently for any longer than 2 weeks.

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
User avatar
Ram
LXF regular
 
Posts: 1679
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough

Postby FranBlakes » Tue Oct 16, 2012 7:09 pm

I have switched the laptop on whilst unknowingly unplugged - only have to go through the slow boot on next power-up (due to BIOS resetting).

It's a wonder they don't make laptops/batteries that when charged 100% `disconnect` from the mains, then start re-charging when the battery reaches 20%.

Just wondering how long the battery will last before it wont charge...
Ubuntu 10.04.4 LTS!
User avatar
FranBlakes
 
Posts: 96
Joined: Wed Dec 01, 2010 9:16 pm
Location: Worcs.

Postby Ram » Tue Oct 16, 2012 10:34 pm

The daughters Medion lasted 19 / 20 months before it stopped charging...

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
User avatar
Ram
LXF regular
 
Posts: 1679
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough


Return to Help!

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests