[MacPorts] #17950: dbus patched with launchd support and version dump
MacPorts
noreply at macports.org
Sun Jan 18 06:05:08 PST 2009
#17950: dbus patched with launchd support and version dump
---------------------------------+------------------------------------------
Reporter: jonas.baehr@… | Owner: macports-tickets@…
Type: enhancement | Status: reopened
Priority: Normal | Milestone: Port Enhancements
Component: ports | Version: 1.7.0
Resolution: | Keywords: launchd kde4 x11
Port: dbus |
---------------------------------+------------------------------------------
Comment(by jonas.baehr@…):
Replying to [comment:44 mta@…]:
> That's more or less the patch I had in mind. I came up with a slightly
different version which I'll attach. The main differences are that
_dbus_server_new_for_launchd_fd uses _dbus_lookup_session_address to get
the socket address. This means that it calls launchctl to get the address
instead of depending on the environment variable being set. This may or
may not be a good idea, but it will make it work in some cases when it
wouldn't otherwise.
That's cleaner, yes. A final version of the launchd patch will certainly
go in this direction. However, simply looking up the session bus address
has the same problem as my hot-fix above: It works only for the session
bus. Your patch should also work with dbus-daemons not spawned by launchd
since it doesn't relies on the env-var, but that's the only benefit.
> I also added code to allow clients to use launchd:... addresses by
adding a new function _dbus_transport_open_launchd to the open_funcs table
in dbus-transport.c. This means that you can set DBUS_SESSION_BUS_ADDRESS
to "launchd:key=server" and start a client and it will work in any process
that is a child of the launchd process that started dbus-daemon. This may
or may not be useful, but it seemed like a good idea.
With the extension to _dbus_server_new_for_launchd_fd any child will
already get a native adress. To allow real launchd addresses in any
context (the original patch supports them only for spawning a server) we
need some kind of mapping between the socket key (used to get the file
descriptor for the server) and the env-var, used to lookup the unix path
to the socket. It doesn't seem possible to lookup both only the the key.
> Custom buses and manually started dbus-daemons work if you give them a
different configuration file. If you use the standard one it will try to
use the same socket as the dbus-daemon started by launchd which probably
won't work no matter what we do. I have a periodic task started by the
root launchd (but running under my ID) that starts a private dbus. This
seems to work fine.
Here I can't follow. Your patch throws an error if the key is not
"session". How should that work with custom busses?
--
Ticket URL: <http://trac.macports.org/ticket/17950#comment:45>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list