3

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?

Chungmin Lee
  • 2,320
  • 2
  • 18
  • 19

1 Answers1

5

Listen for them over D-Bus.

Community
  • 1
  • 1
Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358