Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: init.d/powerfail ?< Next Oldest | Next Newest >
Wittfella Offline





Group: Members
Posts: 33
Joined: Sep. 2006
Posted: Mar. 16 2007,10:37 QUOTE

G'Day, in the inittab file there are a couple of entries relating to power events, like "powerfailnow", which I believe should trigger something to happen if the laptop detects low battery and is about to shutdown.

However the script it is calling is "/etc/init.d/powerfail" which does not seem to exist, at least on my HD install.  Anyone know where the file is, or what it typically contains.

It would be handy if it could popup some sort of message to remind me, because I always start using the laptop and forget to plug it in, and then it just dies suddenly without warning.
Back to top
Profile PM 
curaga Offline





Group: Members
Posts: 2163
Joined: Feb. 2007
Posted: Mar. 16 2007,17:11 QUOTE

You could create your own, with something like:

#!/bin/ash
clear
sync
echo Losing power! Shutting down...
shutdown -h -t1

That's only effective in console.. Wonder how to popup in X? I think there is a program called xmessage, which can be used with something like
xmessage "Battery nearly dead!"


--------------
There's no such thing as life. Those mean little jocks invented it ;)
-
Windows is not a virus. A virus does something!
Back to top
Profile PM 
Wittfella Offline





Group: Members
Posts: 33
Joined: Sep. 2006
Posted: Mar. 17 2007,08:39 QUOTE

Thanks curaga, xmessage works a treat!

The inittab/powerfail stuff doesn't seem to work.  On a little more reading it seems it only relates to UPS type situations.

I installed 'acpid' and got it to work quite easily though.
Back to top
Profile PM 
Juanito Offline





Group: Members
Posts: 1601
Joined: Sep. 2005
Posted: Mar. 17 2007,08:59 QUOTE

I believe you could write a script for acpid to create a warning when there was, say, only 10% battery remaining and execute "exitcheck.sh shutdown" when only 5% remains.

Maybe there is also a way to have torsmo create a warning when there is, say, 10 minutes battery remaining.
Back to top
Profile PM 
3 replies since Mar. 16 2007,10:37 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: init.d/powerfail ?

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code