[systemd-devel] Subscribe from commandline

Lennart Poettering lennart at poettering.net
Wed Mar 5 08:56:06 PST 2014


On Wed, 05.03.14 08:42, Usman (desert03 at yahoo.com) wrote:

> Hi Guys,
> 
> Probably this question has been asked before and it might be a DBus
> list question rather than systemd but just asking anyway, so please
> pardon my ignorance. I am using "dbus-send" to get some properties out
> of systemd dbus messages when an application dies. The thing is that I
> need to send Subscribe first to systemd so that I can receive those
> messages. But if I use dbus-send from commandline it immediately exits
> and then there is no where to receive the death notification messages
> (since there are no active subscriptions). How are you guys testing
> this? Write any script that stays? Any example I can follow? 

Subscribe() is for receiving signals about property changes and
new/removed jobs/units. It is not necessary to call this if you just
want to invoke a method call and want the response for that.

"dbus-send" cannot listen for signals, it only does method invocations,
hence Subscribe() does not apply to it at all...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list