dbus not creating system_bus_socket file on MacOS-X 10.5

Dave Ray clist at JONIVE.COM
Fri Jun 25 13:11:29 PDT 2010


My X11 window manager requires dbus and automatically launches it when  
I start X11.

Dbus seems to launch without error but it doesn't create a  
system_bus_socket file. This is causing problems with my window  
manager, which is expecting a file /var/run/dbus/system_bus_socket.

I ran some tests but am still stumped why the problem persists.

Environment:
MacOS-X 10.5.8 (Leopard)
DBus 1.2.24 (http://www.freedesktop.org/wiki/Software/dbus)
Enlightenment 17 window manager (http://svn.enlightenment.org)
latest Apple X11 development release 2.5.0 (http://xquartz.macosforge.org/trac/wiki 
)
UID and GID for messagebus created

Details:

Dbus seems to launch without error:

 > dbus-launch
DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/ 
dbus-6ANB0XozUs,guid=2816f20e4b2827e9448282fa4c24fed6
DBUS_SESSION_BUS_PID=1651
 >

But no system_bus_socket file anywhere, while it is running. I don't  
think it's a permissions issue.

 > cd /var/run
 > ls -al | grep dbus
drwxrwxrwx   2 messagebus  messagebus      68 Jun 25 12:07 dbus
 > ls dbus
 >
 > sudo find / -name system_bus_socket -print
 >

Dbus installed some things in /usr/local, so I created a similar  
directory there, just in case that was the problem:

 > cd /usr/local/var/run
 > ls -al | grep dbus
drwxrwxrwx   2 messagebus  messagebus      68 Jun 25 12:07 dbus
 > ls dbus
 >


I get the following from dbus-monitor for a normal launching/exiting  
of X11. I think this looks correct.

 > dbus-monitor
signal sender=org.freedesktop.DBus -> dest=:1.1 serial=2 path=/org/ 
freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.1"
method call sender=:1.1 -> dest=org.freedesktop.DBus serial=3 path=/ 
org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='method_call'"
method call sender=:1.1 -> dest=org.freedesktop.DBus serial=4 path=/ 
org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='method_return'"
method call sender=:1.1 -> dest=org.freedesktop.DBus serial=5 path=/ 
org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='error'"
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=7  
path=/org/freedesktop/DBus; interface=org.freedesktop.DBus;  
member=NameOwnerChanged
   string "org.enlightenment.FileManager"
   string ":1.0"
   string ""
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=8  
path=/org/freedesktop/DBus; interface=org.freedesktop.DBus;  
member=NameOwnerChanged
   string "org.enlightenment.wm.service"
   string ":1.0"
   string ""
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=9  
path=/org/freedesktop/DBus; interface=org.freedesktop.DBus;  
member=NameOwnerChanged
   string ":1.0"
   string ":1.0"
   string ""
signal sender=(null sender) -> dest=(null destination) serial=0 path=/ 
org/freedesktop/DBus/Local; interface=org.freedesktop.DBus.Local;  
member=Disconnected


I get the following test results while dbus is running:

 > e_dbus_test
request name
(then it hangs) [ctrl-c]
 > e_dbus_ukit_test
ERR:e_dbus e_dbus.c:467 e_dbus_bus_get() Error connecting to bus:  
Failed to connect to socket /var/run/dbus/system_bus_socket: No such  
file or directory
 > e_dbus_connman_test
ERR:e_dbus e_dbus.c:467 e_dbus_bus_get() Error connecting to bus:  
Failed to connect to socket /var/run/dbus/system_bus_socket: No such  
file or directory
ERROR: can't connect to system session
 >

 > e_dbus_test_client
Sent: 1
Sent: 2
Sent: 3
Sent: 4
Sent: 5
Sent: 6
Sent: 7
Error: org.freedesktop.DBus.Error.ServiceUnknown - The name  
org.e.Repeater was not provided by any .service files
Sent: 8
Error: org.freedesktop.DBus.Error.ServiceUnknown - The name  
org.e.Repeater was not provided by any .service files
Sent: 9
Error: org.freedesktop.DBus.Error.ServiceUnknown - The name  
org.e.Repeater was not provided by any .service files
Sent: 10
Sent: 11
[spews thousands of errors until I control-c]


I used the following config to compile dbus, These seem to be required  
for MacOS, it's the only way I could get dbus to partially work:

./configure --with-system-pid-file=/var/run/dbus/pid --with-system- 
socket=/var/run/dbus/system_bus_socket --with-session-socket-dir=/tmp  
--with-test-socket-dir=/tmp --enable-verbose-mode

I get the following config summary:

                    D-Bus 1.2.24
                  ==============

	prefix:                   /usr/local
	exec_prefix:              ${prefix}
        libdir:                   /usr/local/lib
        libexecdir:               /usr/local/libexec
        bindir:                   /usr/local/bin
        sysconfdir:               /usr/local/etc
        localstatedir:            /usr/local/var
	datadir:                  /usr/local/share
	source code location:	  .
	compiler:		  gcc
	cflags:		          -I/usr/local/include -I/usr/include -I/usr/X11/ 
include -I/usr/include/eina-0 -I/usr/local/include/eina-0/eina -I/usr/ 
local/include/efreet -Wall -Wchar-subscripts -Wmissing-declarations - 
Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align - 
Wdeclaration-after-statement -fno-common -Wno-unused -Wno-sign-compare  
-Wno-pointer-sign -fno-strict-aliasing
	cppflags:		
	cxxflags:		  -g -O2
	64-bit int:		  long long
	32-bit int:		  int
	16-bit int:		  short
        Doxygen:                  no
        xmlto:                    no

        Maintainer mode:          no
        gcc coverage profiling:   no
        Building unit tests:      no
        Building verbose mode:    yes
        Building assertions:      no
        Building checks:          yes
        Building SELinux support: no
        Building inotify support: no
        Building dnotify support: no
        Building kqueue support:  yes
        Building X11 code:        yes
        Building Doxygen docs:    no
        Building XML docs:        no
        Building cache support:   yes
        Gettext libs (empty OK):
        Using XML parser:
        Init scripts style:       none
        Abstract socket names:    no
        System bus socket:        /var/run/dbus/system_bus_socket
        System bus address:       unix:path=/var/run/dbus/ 
system_bus_socket
        System bus PID file:      /var/run/dbus/pid
        Session bus socket dir:   /tmp
        Console auth dir:         /var/run/console/
        Console owner file:       no
        Console owner file path:
	System bus user:          messagebus
	Session bus services dir: /usr/local/share/dbus-1/services
        'make check' socket dir:  /tmp

NOTE: building with verbose mode increases library size, may slightly  
increase security risk, and decreases performance.
 >


Here is the contents of the config file, which I have not changed from  
the default:

 > cat /usr/local/etc/dbus-1/system.conf
<!-- This configuration file controls the systemwide message bus.
     Add a system-local.conf and edit that rather than changing this
     file directly. -->

<!-- Note that there are any number of ways you can hose yourself
     security-wise by screwing up this file; in particular, you
     probably don't want to listen on any more addresses, add any more
     auth mechanisms, run as a different user, etc. -->

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus  
Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

  <!-- Our well-known bus type, do not change this -->
  <type>system</type>

  <!-- Run as special user -->
  <user>messagebus</user>

  <!-- Fork into daemon mode -->
  <fork/>

  <!-- We use system service launching using a helper -->
  <standard_system_servicedirs/>

  <!-- This is a setuid helper that is used to launch system services  
-->
  <servicehelper>/usr/local/libexec/dbus-daemon-launch-helper</ 
servicehelper>

  <!-- Write a pid file -->
  <pidfile>/var/run/dbus/pid</pidfile>

  <!-- Enable logging to syslog -->
  <syslog/>

  <!-- Only allow socket-credentials-based authentication -->
  <auth>EXTERNAL</auth>

  <!-- Only listen on a local socket. (abstract=/path/to/socket
       means use abstract namespace, don't really create filesystem
       file; only Linux supports this. Use path=/whatever on other
       systems.) -->
  <listen>unix:path=/var/run/dbus/system_bus_socket</listen>

  <policy context="default">
    <!-- All users can connect to system bus -->
    <allow user="*"/>

    <!-- Holes must be punched in service configuration files for
         name ownership and sending method calls -->
    <deny own="*"/>
    <deny send_type="method_call"/>

    <!-- Signals and reply messages (method returns, errors) are allowed
         by default -->
    <allow send_type="signal"/>
    <allow send_requested_reply="true" send_type="method_return"/>
    <allow send_requested_reply="true" send_type="error"/>

    <!-- All messages may be received by default -->
    <allow receive_type="method_call"/>
    <allow receive_type="method_return"/>
    <allow receive_type="error"/>
    <allow receive_type="signal"/>

    <!-- Allow anyone to talk to the message bus -->
    <allow send_destination="org.freedesktop.DBus"/>
    <!-- But disallow some specific bus services -->
    <deny send_destination="org.freedesktop.DBus"
          send_interface="org.freedesktop.DBus"
          send_member="UpdateActivationEnvironment"/>
  </policy>

  <!-- Config files are placed here that among other things, punch
       holes in the above policy for specific services. -->
  <includedir>system.d</includedir>

  <!-- This is included last so local configuration can override what's
       in this standard file -->
  <include ignore_missing="yes">system-local.conf</include>

  <include if_selinux_enabled="yes"  
selinux_root_relative="yes">contexts/dbus_contexts</include>

</busconfig>
 >


I re-compiled dbus with unit tests and ran some of them but don't know  
how to interpret results.

 > cd ~/Temp/dbus-1.2.24/test
 > test-names
Successfully acquired name 'org.freedesktop.DBus.Test'
Successfully acquired name 'org.freedesktop.DBus.Test-2'
Successfully acquired name 'org.freedesktop.DBus.Test_2'
 > test-service
 > test-shell-service
 >

Any help appreciated.

Dave




More information about the dbus mailing list