How can I moniter and wait for dbus session is on?

Weng Xuetian wengxt at gmail.com
Tue Jul 26 16:06:01 PDT 2011


On Tue, Jul 26, 2011 at 8:55 PM, Thiago Macieira <thiago at kde.org> wrote:
> On Tuesday, 26 de July de 2011 15:42:03 Weng Xuetian wrote:
>> Hi everyone,
>> In ubuntu/debian system, there is some case that session dbus isn't up,
>> but my app already starts, so dbus_bug_get fails, is there any way to
>> moniter when the dbus is on? (I cannot change the start up phase.)
>
> Sorry, that question doesn't make sense.
>
> If your application is inside a session, then D-Bus is accessible. The
> definition of "session" is "D-Bus session daemon is accessible". Therefore, if
> your application asks for the bus using dbus_bus_get and that fails, that
> means your application is not inside a session.
>
> Inside an X11 display session, the D-Bus daemon can be started automatically.
>
Thank you, then I wonder in which case the dbus_bus_get will get
"Empty Address" error? And if I put a "sleep" before that (I know it's
not a good solution), it would successfully return a usable dbus
connection.


More information about the dbus mailing list