This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Can't tell DBus to load service files from custom location

Tags: None
(comma "," separated)
User avatar
Shaan7
Registered Member
Posts
26
Karma
0
OS
Hi,
I have KDE 4.5 running on Kubuntu 10.10 Maverick and have also compiled KDE trunk in ~/kde. Trunk's dbus service files are in ~/kde/share/dbus-1/services and the distro KDE's service files in /usr/share/dbus-1/services which is the DBus default.
I login to my trunk build using a xsession by setting variables and exec'ing startkde. Everything works fine, except that DBus loads services from /usr/share/dbus-1/services instead of ~/kde/share/dbus-1/services. I am sure of it as by default, dbus starts /usr/bin/bluedevil-helper and if I delete the BlueDevil service file from /usr/share/dbus-1/services , then it starts ~/kde/bin/bluedevil-helper, meaning that it then read the service files from ~/kde/share/dbus-1/services.
Due to this reason there are lots of conflicts and things don't work in trunk because the older DBus service files are loaded. I've used a session-local.conf in /etc/dbus-1 which looks like this -

Code: Select all
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
        <servicedir>/home/hunny/kde/share/dbus-1/services/</servicedir>
</busconfig>


also I set the following variables before starting trunk -

Code: Select all
export XDG_DATA_HOME=$HOME/kde/share
export XDG_DATA_DIRS=$HOME/kde/share


So is there a way I can tell DBus to load the service files from ~/kde/share/dbus-1/services and then don't load services with the same name that exist in /usr/share/dbus-1/services ?

Thanks
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Can you verify that /etc/dbus-1/session.conf contains the appropriate include for session-local.conf?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
Shaan7
Registered Member
Posts
26
Karma
0
OS
Yes, I can see its included, here is session.conf contents-

Code: Select all
<!-- This configuration file controls the per-user-login-session message bus.
     Add a session-local.conf and edit that rather than changing this
     file directly. -->

<!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, don't change this -->
  <type>session</type>

  <!-- If we fork, keep the user's original umask to avoid affecting
       the behavior of child processes. -->
  <keep_umask/>

  <listen>unix:tmpdir=/tmp</listen>

  <standard_session_servicedirs />

  <policy context="default">
    <!-- Allow everything to be sent -->
    <allow send_destination="*" eavesdrop="true"/>
    <!-- Allow everything to be received -->
    <allow eavesdrop="true"/>
    <!-- Allow anyone to own anything -->
    <allow own="*"/>
  </policy>

  <!-- raise the service start timeout to 40 seconds as it can timeout
       on the live cd on slow machines -->
  <limit name="service_start_timeout">60000</limit>

  <!-- Config files are placed here that among other things,
       further restrict the above policy for specific services. -->
  <includedir>session.d</includedir>

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

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

  <!-- For the session bus, override the default relatively-low limits
       with essentially infinite limits, since the bus is just running
       as the user anyway, using up bus resources is not something we need
       to worry about. In some cases, we do set the limits lower than
       "all available memory" if exceeding the limit is almost certainly a bug,
       having the bus enforce a limit is nicer than a huge memory leak. But the
       intent is that these limits should never be hit. -->

  <!-- the memory limits are 1G instead of say 4G because they can't exceed 32-bit signed int max -->
  <limit name="max_incoming_bytes">1000000000</limit>
  <limit name="max_incoming_unix_fds">250000000</limit>
  <limit name="max_outgoing_bytes">1000000000</limit>
  <limit name="max_outgoing_unix_fds">250000000</limit>
  <limit name="max_message_size">1000000000</limit>
  <limit name="max_message_unix_fds">4096</limit>
  <limit name="service_start_timeout">120000</limit> 
  <limit name="auth_timeout">240000</limit>
  <limit name="max_completed_connections">100000</limit> 
  <limit name="max_incomplete_connections">10000</limit>
  <limit name="max_connections_per_user">100000</limit>
  <limit name="max_pending_service_starts">10000</limit>
  <limit name="max_names_per_connection">50000</limit>
  <limit name="max_match_rules_per_connection">50000</limit>
  <limit name="max_replies_per_connection">50000</limit>

</busconfig>
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
It should be working then. It seems like dbus is looking in it's own paths first, then yours, which is contrary to the documentation. Try moving the include statement for your session-local.conf file further up in the session.conf file.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
Shaan7
Registered Member
Posts
26
Karma
0
OS
Yep, you guessed it right, I moved <include>session-local.conf</include> to the first line after <busconfig> and now it loads the one in ~/kde/share/dbus-1/services. Weird, it really is contrary to documentation.
Though I run trunk almost always, isn't there a way to do this using some environment variables? So that if I login to KDE stable (distro packaged one), it loads from default, and when I login to KDE trunk, it loads from custom path?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
You could do this by having a local copy of session.conf in your user account, then having the startup process run dbus-daemon using this configuration file. The command would be:

dbus-daemon --config-file /path/to/local/session.conf

No idea how to handle the environment variables, etc that dbus uses though.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient