#2 Document oddjob behavior with regards to DBus introspection
Opened 5 years ago by abbra. Modified 3 years ago

When working on FreeIPA support for out of process launching for trust topology discovery, I've found out that python-dbus is unable to introspect oddjob-based services.

python-dbus sends introspection requests to unique address rather than to the well-known name. As oddjobd daemon registers all the names at the same unique address and uses the name to decide which service is addressed, it fails to respond with proper dbus introspection data.

python-dbus bindings allow to specify follow_name_owner_changes=True property when retrieving DBus object references from a bus, this forces python-dbus to always address by well-known names instead of unique addresses.

The goal of this ticket is to document the caveat of talking to oddjob-enabled services.

A practical example of how to use python-dbus against oddjob is below:
{{{
import sys
import traceback

import gobject

import dbus
import dbus.mainloop.glib

if name == 'main':
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)

bus = dbus.SystemBus()
try:
    intro = bus.get_object("com.redhat.oddjob_mkhomedir","/", follow_name_owner_changes=True)
except dbus.DBusException:
    traceback.print_exc()
    sys.exit(1)

print intro.Introspect(dbus_interface="org.freedesktop.DBus.Introspectable")

}}}


Note also that this only would work with main loop enabled because otherwise python-dbus is unable to receive signals about name owner change.

Login to comment on this ticket.

Metadata