Get "Connection Error" when invoking dbus_bus_get()
jinqing17
jinqing17 at 163.com
Tue Jan 8 20:09:35 PST 2008
Seems I got the reason.
That's because I started the session bus and run the application as root.
There is a measure that the root doesn't run a sesstion bus. As a result, my application didn't connect to the session bus as any user, especially as root. Is it right?
I still run into another question. If only root exsits and the other user can not be added, how does the session bus work and the application run? I don't know whether using the syetem bus instead would solve this issue.
Thanks a lot.
Qing
在2008-01-09,jinqing17 <jinqing17 at 163.com> :
I started the session bus and connected to it with the same user.
The commands are:
# dbus-daemon --print-pid --print-address --config-file=/etc/dbus-1/session.conf --fork
# export DBUS_SESSION_BUS_ADDRESS=unix:path=/var/run/dbus/session_bus_socket
Whether should I use the system bus instead?
Thanks.
在2008-01-08,"Thiago Macieira" <thiago at kde.org> :
On Tuesday 08 January 2008 11:51:49 jinqing17 wrote:
> Hi,
>
> I'm new to dbus programming.
> I have writen an application to receive/send signals by session bus. When
> running, the following message is given.
>
> Connection Error (Did not receive a reply. Possible causes include: the
> remote a pplication did not send a reply, the message bus security policy
> blocked the rep ly, the reply timeout expired, or the network connection
> was broken.)
>
> This error message was send out when invoking dbus_bus_get(). I looked
> through the source of dbus and found it was emitted in
> _dbus_pending_call_set_timeout_error_unlocked(), which is invoked in
> dbus_connection_send_with_reply().
>
> Why did this error exsit? It there something wrong with the bus's
> configuration? Any information is appieciated! Thanks a lot.
Are you connecting to a session bus started by another user?
--
? Thiago Macieira ?- ?thiago (AT) macieira.info - thiago (AT) kde.org
? ? PGP/GPG: 0x6EF45358; fingerprint:
? ? E067 918B B660 DBD1 105C ?966C 33F5 F005 6EF4 5358
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20080109/04e571cd/attachment.html
More information about the dbus
mailing list