LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 01-24-2004, 12:53 AM   #1
gokul
Member
 
Registered: Jun 2002
Distribution: mandrake,redhat,fedora
Posts: 34

Rep: Reputation: 15
Power Button for Shutdown


Details:

I use Mandrake 9.2 with a kernel I compiled with ACPI and APM support.
The kernel is 2.6.1. Patches for supermount has also been applied.

Question:

How to make use of the powerbutton on the cabinet to powerdown my linux system.
 
Old 01-24-2004, 02:48 AM   #2
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
You don't I think. Just type halt or reboot as root into any command prompt.
 
Old 01-24-2004, 03:32 AM   #3
gokul
Member
 
Registered: Jun 2002
Distribution: mandrake,redhat,fedora
Posts: 34

Original Poster
Rep: Reputation: 15
Well I know the other ways to shutdown the conputer. I need to know about this. If it is possible in say, windoze then it "must" be possible in our Linux. A nifty feature for desktop users. Would not mind hibernating my system either. I am waiting for the SWAP "file" implementation of hibernation in Linux 2.6+.

Thanks for the interest.
 
Old 01-24-2004, 04:19 AM   #4
hazza
Member
 
Registered: Nov 2003
Location: Australia
Distribution: Mandrake, SUSE, Fedora
Posts: 122

Rep: Reputation: 15
If you have acpi enabled at boot (acpi=on kernel arguemnt) then all you have to do is get the acpi and acpid services running:

# chkconfig acpid on
# chkconfig acpi on
# service acpid start
# service acpi start

If you don't see any output when you start the acpid service then chances are acpid wasn't enabled at boot. Provided you have the suspend-scripts package then /etc/acpid/events/power should look something like this:

event=button/power (PWR.|PBTN)
action=/sbin/poweroff

So when you press the power button /sbin/poweroff is run. I haven't tried this with kernel 2.6.x but I have managed to shutdown my box by pressing the power button.
 
Old 01-24-2004, 01:40 PM   #5
gokul
Member
 
Registered: Jun 2002
Distribution: mandrake,redhat,fedora
Posts: 34

Original Poster
Rep: Reputation: 15
U were right hazza. I just had to enable the services and voila!
Thanks!:-)
Can u trap the reboot button and do a proper reboot with a high priority interrupt or something? It might help when the computer hangs hopelessly(although a lot less for other people. I fiddle around a lot!)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ACPI: shutdown computer by pushing power button... elluva Mandriva 10 12-15-2003 04:57 AM
RH 9 orderly shutdown by power button? geezjan Red Hat 1 09-19-2003 11:01 AM
Automatic shutdown when power button pressed.. mr_smidge Linux - General 9 09-08-2003 03:16 AM
Shutdown with power button hriosm Linux - Hardware 4 06-06-2003 03:43 PM
Shutdown routine with power button bfought Linux - Newbie 2 09-09-2002 07:23 PM


All times are GMT -5. The time now is 03:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration