What DBus signal is sent on system suspend?
Posted
by
Paul Robinson
on Server Fault
See other posts from Server Fault
or by Paul Robinson
Published on 2010-10-15T15:07:21Z
Indexed on
2011/02/19
7:26 UTC
Read the original article
Hit count: 578
ubuntu-9.04
|fedora13
Hello,
I need to detect when a machine is going to sleep in Ubuntu 9.10 and Fedora 13. Both use UPower, so I've been looking on the "org.freedesktop.UPower" DBus bus for such signals.
I've been listening for the "sleeping" signal on the UPower bus with the following command:
dbus-monitor --system "type='signal',interface='org.freedesktop.UPower',member='Sleeping'"
When I sleep the machine (either by closing the lid, selecting "shutdown -> suspend" or sending a DBus message) I don't see a "sleeping" event.
I notice that the "Sleeping" event is sent when the "org.freedesktop.UPower.AboutToSleep" method is invoked. I can do this manually by calling:
dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.AboutToSleep
And I notice the "sleeping" signal is fired. My understanding is that anything that sleeps the PC must send the "AboutToSleep" signal before hand. It doesn't seem like this is happening. I've tried these steps on both Fedora 13 and Ubuntu 9.10 and I see the same results.
Can anyone explain what's happening or provide me with an alternative DBus signal to listen for?
Many thanks,
Paul
© Server Fault or respective owner