سؤال

I want to make a Linux application that send a message to a remote host when a local system (where the application runs) is going to suspend, hibernate or shutdown. I googled how to do this and found acpi_listen but it doesn't work.

Here is the result of ps aux | grep acpi on the system I tested (Ubuntu 10.04 LTS):

root        35  0.0  0.0      0     0 ?        S    Dec03   0:00 [kacpid]
root        36  0.0  0.0      0     0 ?        S    Dec03   0:00 [kacpi_notify]
root        37  0.0  0.0      0     0 ?        S    Dec03   0:00 [kacpi_hotplug]
root       934  0.0  0.0   2048   872 ?        Ss   Dec03   0:00 acpid -c /etc/acpi/events -s /var/run/acpid.socket

Communicating with acpid directly via a UNIX domain socket wouldn't work since that's the way acpi_listen works, although I didn't try it. Is there any other way?

هل كانت مفيدة؟

المحلول

Listen for them over D-Bus.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top