On 18-05-2012 12:18, Bruce Dubbs wrote:
> Andrew Benton wrote:
>> On Fri, 18 May 2012 14:44:00 +0100 xinglp <xin...@gmail.com> 
>> wrote:
>> 
>>> In order to use "power button" to shutdown or suspend my lfs. I 
>>> enabled the depreciate  /proc/acpi/event in kernel, and install 
>>> acpid to handle the button event. It works well.
>>> 
>>> But is there any clear way to do that, such as by inittab or
>>> udev or kernel callout userspace script ( 
>>> /proc/sys/kernel/poweroff_cmd has somethings )
>>> 
>>> I've looked into blfs, there's a lot more packages need to be 
>>> installed to enable this.(I'm not a X user,for now.)
>> 
>> I don't know of any other way of handling the power button event
>> at init 3. I used to install acpid, like you, for this reason but
>> I stopped as I hardly spend any time at the command prompt
>> nowadays. So what I do now is alter /etc/inittab so that it handles
>> ctrl alt del by shutting down instead of rebooting:
>> 
>> ca:12345:ctrlaltdel:/sbin/halt
>> 
>> When X is running I have my window manager (Openbox) handle 
>> pressing the power button (xev says it is XF86PowerOff) by running
>>  a script which (after it's tidied up a few things) calls 
>> /sbin/halt.
> 
> Just a suggestion.  You could write a short script to run at C-A-D 
> and ask if you want to shut down or reboot.  I don't know if this 
> would run in a window manager or not.
> 
> -- Bruce

With window managers, I used a script to open xterm and ask me to
{shutdown, reboot, close session}. Then, noticed several Live CDs, such
as pmagic (and systemrescuecd, if I recall correctly), which used small
scripts in xdialog. I know other distribution Live CDs with the same,
but do not remember now. That what I am using now, but with mouse click.
It would be possible possible for a initial script to test for X and
then execute for console or X, I believe.

-- 
[]s,
Fernando

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to