standardmäßig löst ein Druck auf den Powerbutton des Rechners ja einen Shutdown aus. Da ich an dieser Stelle gern ein S4 (hibernate) hätte, habe ich die Datei /etc/acpi/events/powerbtn-acpi-support entsprechend angepasst:
Code: Alles auswählen
event=button[ /]power
action=/etc/acpi/hibernatebtn.sh
Zur Info hier der Inhalt der /etc/acpi/hibernatebtn.sh:
Code: Alles auswählen
#!/bin/sh
test -f /usr/share/acpi-support/state-funcs || exit 0
. /usr/share/acpi-support/policy-funcs
if [ `CheckPolicy` = 0 ]; then
# If gnome-power-manager or klaptopdaemon are running, generate the X "sleep"
# key. The daemons will handle that keypress according to their settings.
. /usr/share/acpi-support/key-constants
acpi_fakekey $KEY_SUSPEND
else
# No power management daemons are running. Divert to our own implementation.
/etc/acpi/hibernate.sh
fi
Code: Alles auswählen
#!/bin/sh
test -f /usr/share/acpi-support/state-funcs || exit 0
. /etc/default/acpi-support
if [ x$ACPI_HIBERNATE != xtrue ] && [ x$1 != xforce ]; then
exit;
fi
pm-hibernate
Das einzige, was mich stutzig macht, ist die Datei /etc/acpi/powerbtn-acpi-support.sh:
Code: Alles auswählen
#!/bin/sh
# This script initiates a shutdown when the power putton has been
# pressed. Loosely based on the sample that ships with the acpid package.
# If the acpid sample is present as a real config file (as it was in earlier
# versions of acpid), we skip this script. (Purging and reinstalling acpid
# resolves this situation, or simply deleting /etc/acpi/events/powerbtn.)
if [ -f /etc/acpi/events/powerbtn -o -f /etc/acpi/events/powerbtn.dpkg-bak ] ; then
logger Acpi-support not handling power button, acpid handler exists at /etc/acpi/events/powerbtn or /etc/acpi/ events/powerbtn.dpkg-bak.
exit 0
fi
[ -e /usr/share/acpi-support/policy-funcs ] || exit 0
. /usr/share/acpi-support/policy-funcs
if [ `CheckPolicy` = 0 ] ; then
exit 0
fi
if [ -x /etc/acpi/powerbtn.sh ] ; then
# Compatibility with old config script from acpid package
/etc/acpi/powerbtn.sh
elif [ -x /etc/acpi/powerbtn.sh.dpkg-bak ] ; then
# Compatibility with old config script from acpid package
# which is still around because it was changed by the admin
/etc/acpi/powerbtn.sh.dpkg-bak
else
# Normal handling.
/sbin/shutdown -h -P now "Power button pressed"
fi
Hat jemand vlt. Tipps, was da noch schief läuft?