das sind für gewöhnlich acpi -events, um die es da geht. Manchmal auch apm.
Wie die behandelt werden, ich kompliziert und ich habe es nicht voll verstanden. Yamagi hatte aber mal ein schönes Beispiel eines Scriptes hier veröffentlicht, mit dem er seinem Laptop alles nötige beigebracht hatte.
Grundsätzlich werden zahlreiche acpi-Variablen in den sysctl settings behandelt.
ein sysctl -ao | grep acpi zeigt schon etliches. Da kann grundsätzlichzum Beispiel entschieden werden, welcher Modus zum Beispiel genommen wird. Ich zeige mal einen Auszug:
Code:
hw.acpi.supported_sleep_state: S3 S4 S5
hw.acpi.power_button_state: S5
hw.acpi.sleep_button_state: S3
hw.acpi.lid_switch_state: NONE
hw.acpi.standby_state: NONE
hw.acpi.suspend_state: S3
hw.acpi.sleep_delay: 1
Ich stelle mir vor, dass hier grundsätzlich der Sleep-Modus vollkommen verhindert werden kann und damit dein Problem umgangen wird.
Nicht schön, ok. Denn eigentlich willst du ja nur die Taste lahmlegen.
Für meinen Asus hatte ichmal eine /etc/devd.conf im Netz gefunden und zitiere mal daraus:
Code:
# User requested suspend, so perform preparation steps and then execute
# the actual suspend process.
notify 10 {
match "system"
"ACPI";
match "subsystem"
"Suspend";
action "/etc/rc.suspend acpi $notify";
};
notify 10 {
match "system"
"ACPI";
match "subsystem"
"Resume";
action "/etc/rc.resume acpi $notify";
};
# The next blocks enable volume
notify 0 {
match "system"
match "subsystem"
match "notify"
action
};
hotkeys that can be found on the Asus EeePC
"ACPI";
"ASUS-Eee";
"0x13";
"mixer 0";
notify 0 { "ACPI";
match "system" "ASUS-Eee";
match "subsystem" "0x14";
match "notify" "mixer vol -10";
action
};
notify 0 { "ACPI";
match "system" "ASUS-Eee";
match "subsystem" "0x15";
match "notify" "mixer vol +10";
action
};
/* EXAMPLES TO END OF FILE
# The following might be an example of something that a vendor might
# install if you were to add their device. This might reside in
# /usr/local/etc/devd/deqna.conf. A deqna is, in this hypothetical
# example, a pccard ethernet-like device. Students of history may
# know other devices by this name, and will get the in-jokes in this
# entry.
nomatch 10 {
match "bus" "pccard[0-9]+";
match "manufacturer" "0x1234";
match "product" "0x2323";
action "kldload if_deqna";
};
attach 10 {
device-name "deqna[0-9]+";
action "/etc/pccard_ether $device-name start";
};
detach 10 {
device-name "deqna[0-9]+";
action "/etc/pccard_ether $device-name stop";
};
#
#
#
#
#
Examples of notify hooks. A notify is a generic way for a kernel
subsystem to send event notification to userland.
Here are some examples of ACPI notify handlers. ACPI subsystems that
generate notifies include the AC adapter, power/sleep buttons,# control method batteries, lid switch, and thermal zones.
#
# Information returned is not always the same as the ACPI notify
# events. See the ACPI specification for more information about
# notifies. Here is the information returned for each subsystem:
#
# ACAD:
AC line state (0 is offline, 1 is online)
# Button:
Button pressed (0 for power, 1 for sleep)
# CMBAT:
ACPI battery events
# Lid:
Lid state (0 is closed, 1 is open)
# Suspend, Resume: Suspend and resume notification
# Thermal:
ACPI thermal zone events
#
# This example calls a script when the AC state changes, passing the
# notify value as the first argument. If the state is 0x00, it might
# call some sysctls to implement economy mode. If 0x01, it might set
# the mode to performance.
notify 10 {
match "system"
"ACPI";
match "subsystem"
"ACAD";
action
"/etc/acpi_ac $notify";
};
*/
Damit wurden die Funktionstasten des Asus nutzbar, ich zeige hier den Teil, der wohl mit Suspend und sleep zu tun hat.
Wie das genau wirkt und ob da noch andere Dienste und Einstellungen nötig waren, erinnere ich nun nicht, was natürlich auch bedeutet, dass ich das nie verstanden habe und mich nur durchgearbeitet hatte.
Sodann gibt es mit HAL und DBUS zahlreiche Möglichkeiten, Suspend und sleep-Verhalten über entsprechende Konfigurationsdateien zu bestimmen. Und nicht zu vergessen: manche Desktop-Environments wie etwa KDE bringen eigene Subsysteme mit oder können die Variablen direkt verändern.
Ziemlich unübersichtlich.
Schon bei den Grundlagen bin ich unsicher.
Früher hatte ich für derlei Funktionen APM nutzen können, nun soll ACPI dafür stehen. die /etc/apm.conf gibt es aber noch immer und es gibt auch noch entsprechende Programme und Dienste.
Also, bei mir herrscht da ein wenig Konfusion und vielleicht ist das hier eine schöne Gelegenheit, mal mehr Licht in die Sache zu bringen.