LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 04-11-2005, 08:42 AM   #1
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Exclamation How to Shutdown with Power Button?


How can I make it so that when I hit the power button on the case my PC will go through it's regular shutdown sequence (runlevel 0)?

Right now if I hit the power button the PC goes into like a sleep mode or something and I need to hit a key on the keyboard to wake it up. I'd like to change that sleep mode for a shutdown/halt. How can I accomplish this?

BTW, I am using Linux 2.4.29 (APM). Thanks!


Last edited by win32sux; 04-11-2005 at 11:36 AM.
 
Old 04-11-2005, 02:29 PM   #2
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
Hrm, usually holding down the power button for 3 to 4 seconds will cause it to power off...don't know if it does anything on the system level.
 
Old 04-11-2005, 04:58 PM   #3
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Original Poster
Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally posted by Technoslave
Hrm, usually holding down the power button for 3 to 4 seconds will cause it to power off...don't know if it does anything on the system level.
thanks for the reply...

yeah, holding the button down for a few seconds cuts the power abruptly - a very bad thing, as the shutdown scripts aren't run...

i need the system to go into runlevel 0 when the power button is hit (without the need to hold it down)...

i want the effect of hitting the power button to be the same as issuing the "shutdown -h now" command...
 
Old 04-12-2005, 11:42 AM   #4
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
That's not going to happen, AFAIK. What it does is causes the hard drives to write out their cache and then shuts everything down in as gentle a state as possible, as compared to say an abrupt power loss. The kernel may or may not interpret this correctly, maybe someone else will know.

The only problems you should see with regards to applications are those that when starting look to see if a pid file is present then refuse to start up b/c it wasn't shut down properly. I don't know of many that do that though.
 
Old 07-01-2006, 02:14 AM   #5
mpdc
LQ Newbie
 
Registered: May 2005
Location: Denmark
Distribution: Mandriva
Posts: 5

Rep: Reputation: 0
I run the latest mandriva on a Fujitsu-Siemens Scenic xS. When I push the power button, it logs off properly and does a regular shutdown. However, thhe next time I start, it boots in CLI instead of X.
 
Old 07-01-2006, 12:02 PM   #6
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
Quote:
Originally Posted by mpdc
However, thhe next time I start, it boots in CLI instead of X.
Just enter the following to start X
Code:
startx
 
Old 07-01-2006, 01:19 PM   #7
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
You need ACPI enabled in kernel and acpid running. Then the powerbutton will trigger an ACPI event, I believe it is shutdown by default.
 
  


Reply



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
Laptop power button it-s SUSE / openSUSE 4 03-31-2005 09:24 PM
Needs to push power button to power off? danpin Linux - Newbie 5 10-21-2003 08:08 PM
Power Button under linux aaa Slackware 18 07-11-2003 11:25 AM
Shutdown with power button hriosm Linux - Hardware 4 06-06-2003 02:43 PM
Can I use the power button like in Windows? Mackan Linux - Newbie 2 03-16-2002 03:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:42 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
Open Source Consulting | Domain Registration