[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Question: Power Button Shutdown



Hi,

I found a description on how to to shut down my system after pushing the power 
button (below).  I need this for a headless system.  The system is running 
Debian-Lenny, and it used to work before a dist-upgrade quite a while back.  
I only found out it was working by accident, because it does not seem to work 
on other Debian machines I have.

I was just wondering if this is set up normally on a Debian install, and if 
yes what may have stopped it from working.  If all else fails I'll try the 
method described below, but I'd rather just fix what was working before.

Chris

http://wiki.archlinux.org/index.php/Shutting_system_down_by_pressing_the_power_button

Shutting system down by pressing the power button
From ArchWiki

If you want to shutdown your system by simply pressing the power button, do 
the following:

   1. Install the acpid package.
   2. If there is no hal in the DAEMONS array in rc.conf, add acpid to the 
DAEMONS array.
   3. Create a file in /etc/acpi/events/ named power with following content: 

# /etc/acpi/events/power
# This is called when the user presses the power button

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

To be able to test it, start the acpid daemon:

# /etc/rc.d/acpid start

From now on, pressing the power button (lightly, not for a few seconds) should 
properly shutdown the system. Note that if you have hibernate configured and 
working you may want to change the last line with:

action=/usr/sbin/hibernate

However, if you're using more sophisticated WM, you should use its own 
shutdown call, so it'd save its session etc.

To accomplish it in KDE 3, simply change the action to:

action=/opt/kde/bin/dcop --all-users --all-sessions ksmserver ksmserver logout 
0 2 0

-- 
C. Hurschler


Reply to: