[systemd-devel] Subscribe from commandline

Usman desert03 at yahoo.com
Wed Mar 5 15:23:37 PST 2014


Thanks Lennart. Is there a way I can do it from shell rather than writing C or Java code? I just want to quickly verify that the messages I get once Unit state changes. Any example? 

Thanks.



On Wednesday, March 5, 2014 2:22 PM, Lennart Poettering <lennart at poettering.net> wrote:
 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140305/1517545d/attachment.html>


More information about the systemd-devel mailing list