Re: shutdown on pressing the ATX power button

Pavel Machek (pavel@suse.cz)
Thu, 9 Aug 2001 19:56:05 +0200


Hi!

> is there any way to let the system execute something by pressing the ATX
> power button (preferrable executing 'shutdown -h now', but would be nice
> if it was configurable)
>
> I looked into the (very large) list archive but didnt find any answer.
> if it is a kind of FAQ or off topic, please point me to the place I could
> find an answer.

Try this, and put this: into inittab

# Action on special keypress (ALT-UpArrow)
kb::kbrequest:/etc/rc/rc.reboot 2 0

--- clean/drivers/acpi/events/evevent.c Sun Jul 8 23:26:27 2001
+++ linux/drivers/acpi/events/evevent.c Sun Jul 8 23:25:01 2001
@@ -193,6 +168,8 @@

if ((status_register & ACPI_STATUS_POWER_BUTTON) &&
(enable_register & ACPI_ENABLE_POWER_BUTTON)) {
+ printk ("acpi: Power button pressed!\n");
+ kill_proc (1, SIGWINCH, 1);
int_status |= acpi_ev_fixed_event_dispatch (ACPI_EVENT_POWER_BUTTON);
}

-- 
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss@linmodems.org
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/