System and Session Bus

Thiago Macieira thiago.macieira at trolltech.com
Mon Mar 20 02:17:52 PST 2006


Oliver Frommel wrote:
>> - What is the point in having a separate session bus when
>>
>> > a system bus is already running?
>>
>> The system bus is there to provide coordination between system-wide
>> services that are independent
>> of individual users and their apps running, while the session bus is
>> there for "desktop communication" primarily,
>> that is, to provide coordination and communication between apps that
>> an individual user would run (as opposed
>> to apps/services that the "system would run").
>
>Ok, thank you so far.
>Can you provide any more actual use cases / examples for
>both busses? For instance if I want to make use of HAL
>I have to connect to the system bus, right?

Querying for the list of available hardware: system bus.
Querying if the screensaver is on: session bus.
Asking the browser to start and open an URL: session bus.
Asking the system to go into sleep/hibernate mode: system bus.

>In order to have my application communicate with other
>programs running in my desktop session I would connect to
>my session bus. In practice that would mean most applications
>would need to connect to both busses.

No...

I don't expect most applications to need to connect to the system bus at 
all. Why should my text editor need to know my hardware device listing?

And if you answer accessibility hooks like text-to-speech or other input 
devices, I don't expect *applications* do to that by themselves, but for 
it to be handled by a library or external process.

>When I list the interface names of both busses on FC5 I get:
>(system:)
>[u'org.freedesktop.DBus', u':1.7', u':1.8',
>u'org.freedesktop.NetworkManagerInfo', u'org.freedesktop.Avahi',
>u':1.10', u'com.redhat.CupsDriverConfig', u':1.1',u':1.2',
>u'org.freedesktop.Hal', u':1.3', u':1.4', u':1.5',
>u'com.redhat.PrintDriverSelection', u':1.6']
>
>(session:)
>[u'org.freedesktop.DBus', u':1.3', u':1.0', u':1.1',
>u'com.redhat.PrinterManager']
>
>So what is the purpose and difference of the printer services
>that are available on the respective busses.

My guess would be that you control the user-local printers or the 
system-wide printers (all users). I'd also expect that you cannot change 
the printer configuration via D-Bus on a system-wide level.

>And to come back to my original question: is it possible to
>connect both busses, maybe just in respect to certain services.
>For example I could imagine to have the session bus relay
>all HAL events from the system bus.

You can connect to both busses. I see no need to relay events from one bus 
to another: if an app is interested in an event that happens in the 
system bus, it'll connect to such bus.

-- 
Thiago José Macieira - thiago.macieira AT trolltech.com
Trolltech AS - Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060320/6c77720f/attachment.pgp


More information about the dbus mailing list