[RFC] Patch to allow a DBusConnection to be recreated from an fd

James Hunt james.hunt at ubuntu.com
Tue Mar 5 03:54:29 PST 2013


As of version 1.6, Upstart supports stateful re-exec. This works fine except
that any clients connected to it via D-Bus at the time it re-execs have their
connections severed. This is handled currently by having those jobs respawn. A
better solution would be to allow Upstart to recreate the DBusConnections
post-re-exec.

The 2 patches attached provide the ability for such a D-Bus application to
restart and maintain existing D-Bus connections by:

- Making _dbus_connection_get_address() public as dbus_connection_get_address().

- Adding a new dbus_connection_open_from_fd() call that allows a DBusConnection
to be recreated from an existing open file descriptor.

The first would allow Upstart to encode the address associated with the fd when
passing state to the new instance, whilst the second change allows that
information to be used to recreate the original DBusConnection.

[1] - https://wiki.ubuntu.com/FoundationsTeam/Specs/QuantalUpstartStatefulReexec

Kind regards,

James.
--
James Hunt
____________________________________
http://upstart.ubuntu.com/cookbook
http://upstart.ubuntu.com/cookbook/upstart_cookbook.pdf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-ability-to-recreate-a-DBusConnection-from-an-exi.patch
Type: text/x-diff
Size: 21078 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20130305/79a519ad/attachment-0002.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Make-_dbus_connection_get_address-public.patch
Type: text/x-diff
Size: 2076 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20130305/79a519ad/attachment-0003.patch>


More information about the dbus mailing list