D-Bus session bus

Ralf Habacker ralf.habacker at freenet.de
Fri Aug 27 17:18:44 CEST 2010


Kevin Krammer schrieb:
> Hi Ralf,
>
> On Thursday, 2010-08-26, Ral Habacker wrote:
>   
>> Kevin Krammer schrieb:
>>     
>>> Hi folks,
>>>
>>> I had some difficulties today getting the D-Bus session bus setup right.
>>>
>>> The base situation is like this:
>>>
>>> KDE is built into C:\KDE\trunk using emerge
>>> I am working on a "BitRock Install Builder" based installer for an
>>> application which uses Akonadi.
>>> The installer puts Akonadi, the application and some Akonadi resources
>>> into a subdirectory in c:\Program Files.
>>>
>>> When I run the application, it starts D-Bus and Akonadi (good), Akonadi
>>> starts the agents (it also finds the ones in C:\KDE\trunk\bin, but still
>>> ok).
>>>
>>> However, each of those started from %KDEROOT% starts its own D-Bus and
>>> its own Akonadi!
>>>
>>> Andreas hinted that I could try changing the D-Bus config to use tcp
>>> instead of autolaunch [1].
>>> Doing that made the app start D-Bus but fail to detect that (dbus-daemon
>>> was shown running in the process monitor, but the app complained about
>>> it not finding the session bus).
>>>
>>> I now got it working by commenting the patch apply setion in
>>> emerge/portage/win32libs-sources/dbus-src/dbus-src-1.3.1.py and using
>>> D-Bus config tcp with host and port.
>>>       
>> The related patch extends the autolaunch feature with an installation
>> directory limited session bus.
>> This feature is required for multiple kde installations. It is enabled
>> by using the session bus address "autolaunch:scope=install-path"
>>     
>
> Right.
> Maybe install path is just the wrong criteria, maybe something like "KDE 
> Version"?
>   
Two questions:

1. Does akonadi and all other package installed outside the main kde 
installation path follow the KDE version ?

dbus-daemon reads it session bus address from session.conf file and dbus 
client library reads it from compile time settings or environment. How 
to set this on install time (daemon) or runtime (client) ?

The scope parameter could be set to any other value to select a 
dedicated session bus, for example autolaunch:scope=kde-4.4
>>> Since hardcoding a port is quite likely a bad idea, any suggestions what
>>> I could try instead?
>>>       
>> in
>> http://websvn.kde.org/trunk/kdesupport/emerge/portage/win32libs-sources/dbu
>> s-src/dbus-src-1.3.1.py?view=log there is a line
>> self.subinfo.options.configure.defines = "-DDBUS_ENABLE_XML_DOCS=OFF
>> -DDBUS_USE_EXPAT=ON
>> -DDBUS_SESSION_BUS_DEFAULT_ADDRESS:STRING=autolaunch:scope=install-path"
>>
>> change it to
>>
>> self.subinfo.options.configure.defines = "-DDBUS_ENABLE_XML_DOCS=OFF
>> -DDBUS_USE_EXPAT=ON -DDBUS_SESSION_BUS_DEFAULT_ADDRESS:STRING=autolaunch"
>>
>> and recompile dbus-src.
>> I guess we need a dbus client config file to be able to set this without
>> using an environment variable.
>>     
>
> I did that and rebuilt  dbus-src like this
>
> emerge -i dbus-src
>
> But now the application doesn't start D-Bus anymore.
>   
if you run dbus-daemon --session by hand or with a debugger you will see 
that it crashes. I fixed the crash in emerge dbus-src portage script - 
you should update your emerge portage tree.

> When I run it (from console or by double-clicking in Explorer), it complains 
> about no session bus being found (like in my first attempt to fix this from 
> above) but dbus-daemon.exe is really not running this time.
>
> Do I need to rebuild something else as well?
>   
see above.

Just one note: The remaining session bus address has to be 
'autolaunch:'  not 'autolaunch'

Regards
Ralf



More information about the Kde-windows mailing list