Session Bus vs. System Bus

Jehne, Dennis jehne at 4com.de
Tue Jul 11 08:02:20 PDT 2006


Hello all,
I have successfully started a session bus with two applications sending and receiving signals. (Ping Pong)
I use the dbus-0.62 package on Red Hat Enterprise 4 which I installed in /etc
 
To start the session bus I do the following:
1- I kill all other dbus stuff (running Redhat E4 there is a message bus automatically started which I kill for my tests)
2- execute eval `dbus-launch --sh-syntax --exit-with-session` in one session where the "Ping" App runs in 
3- export the env var DBUS_SESSION_BUS_ADDRESS to my second session where the other app (Pong) runs in
4- start both applications and everything works ok
 
I´m now trying to do this over the system bus which in my understanding should be availbale in all sessions, so I don´t need to export the env var everytime I start the session bus. 
But somehow I get the same error Hobin Yoon reported earlier in his mail to the list. 
I´ll do the following:
 
[root at localhost tools]# dbus-daemon-1 --system
Failed to start message bus: The pid file "/var/run/messagebus.pid" exists, if the message bus is not running, remove this file
[root at localhost tools]# rm /var/run/messagebus.pid 
[root at localhost tools]# dbus-daemon-1 --system     
[root at localhost tools]# ps aux | grep bus
root     11313  0.0  0.2  4004  856 ?        Ss   16:44   0:00 dbus-daemon --fork --print-pid 8 --print-address 6 --session
dbus     11364  0.1  0.3  3456 1228 ?        Ss   16:46   0:00 dbus-daemon-1 --system
root     11366  0.0  0.1  5036  712 pts/0    S+   16:46   0:00 grep bus
[root at localhost tools]# ./dbus-monitor --system
Failed to open connection to system message bus: Failed to connect to socket /usr/local/var/run/dbus/system_bus_socket: No such file or directory
[root at localhost tools]#
 
Pretty much the same happens when I try to start my test apps. They also fail to open the connection with the error.
 
[root at localhost debug]# ps aux | grep bus
root     11313  0.0  0.2  4004  856 ?        Ss   16:44   0:00 dbus-daemon --fork --print-pid 8 --print-address 6 --session
dbus     11364  0.0  0.3  3456 1228 ?        Ss   16:46   0:00 dbus-daemon-1 --system
root     11400  0.0  0.1  5852  712 pts/1    S+   17:07   0:00 grep bus
[root at localhost debug]# ./dbusPing test.bus.dj 500 Hello
Read the following: argc <4>
Name <test.bus.dj> 
MsgSize <500>
Msg<Hello>
Connection Error (Unable to determine the address of the message bus (try 'man dbus-launch' and 'man dbus-daemon' for help))
DBus: dbus_bus_get NOT OK, exiting 
MAIN - NACH get_bus
exit in get_bus
[root at localhost debug]# 
 
So, as I have read in the archive and the last mail from Havoc Pennington to Hobin Yoon, that it´seems that dbus-monitor was build with a different prefix,I have tried to rebuild dbus-monitor in my /etc/dbus-0.62/tools path. Before doing this I changed the following in the Makefile in the tools directory:
 
#DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = unix:path=/usr/local/var/run/dbus/system_bus_socket
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = unix:path=/var/run/dbus/system_bus_socket
#DBUS_SYSTEM_PID_FILE = /usr/local/var/run/messagebus.pid
DBUS_SYSTEM_PID_FILE = /var/run/messagebus.pid
#DBUS_SYSTEM_SOCKET = /usr/local/var/run/dbus/system_bus_socket
DBUS_SYSTEM_SOCKET = /var/run/dbus/system_bus_socket
 
But unfortunately this doesn´t work.
 
I have also tried to change this <listen> path in the system.conf to the "/var/run/dbus/system_bus_socket" directoy, but there is no change.
 
I´m a bit stuck at the momemt and it seems I haven´t understood the principle yet.
 
My question would be: What am I doing wrong and how do I need to start a system bus that my apps are able to find the address of the message bus?
 
I have searched the list archive already but could not find a useful hint yet.
 
Every hint is very appreciated.
 
Many thanks for your help in advance and regards,
Dennis Jehne
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20060711/b29a5a4b/attachment.html


More information about the dbus mailing list