ACPI: getting front-panel power button to cause shutdown

YONETANI Tomokazu qhwt+dfly at les.ath.cx
Tue Nov 28 01:07:05 PST 2006


On Sat, Nov 25, 2006 at 08:04:26PM +0000, David Murray wrote:
> I'm trying to get the front-panel power button to shut the system down 
> (cleanly).  Currently when I press it, nothing discernible happens (no 
> console messages, nothing logged, and certainly no shutdown).

Some of machines around me have this problem too, but I have never cared
to investigate :)

>  shutdown -p now, and
>  acpiconf -s 5
> 
> both work just fine, which makes me think nothing's fundamentally broken.

[looks ok to me too]

> Can anyone suggest what I might do to diagnose what's going on?  I'll 
> happily provide more info, if it helps.

Pressing the power button delivers an interrupt to the acpi driver,
and it triggers an event handler which winds up to call a function
acpi_SetSleepState(), so the first step is to see if an interrupt is
delivered to the acpi driver.
  $ vmstat -i |grep acpi
  (press power button)
  $ vmstat -i |grep acpi

The number doesn't change on machines with non-working power button here,
so I need to find why it's not.
But if it does on your machine, try rebuilding the driver with debugging
support and see what's happening:
  % sh
  $ export MAKEOBJDIRPREFIX=$HOME/obj ACPI_DEBUG=yes
  $ cd /sys/dev/acpica5
  $ make obj && make depend
  $ su
  (you're asked the root password here)
  # make install
  # echo 'debug.acpi.layer="ACPI_EVENTS ACPI_BUTTON"'>>/boot/loader.conf
  # echo 'debug.acpi.level="ACPI_LV_FUNCTIONS ACPI_LV_INFO"'>>/boot/loader.conf
  # reboot

Cheers.





More information about the Users mailing list