<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>77504</bug_id>
          
          <creation_ts>2005-01-11 04:16 0000</creation_ts>
          <short_desc>Start DBUS session bus on KDE session start</short_desc>
          <delta_ts>2007-02-13 20:03:38 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>GNOME</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          <bug_file_loc>http://code.eikke.com/index.php?dir=misc/&amp;file=gdm-xsession-dbus.patch</bug_file_loc>
          
          
          <priority>P5</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>88043</blocked>
          
          <everconfirmed>1</everconfirmed>
          <reporter>eikke@eikke.com</reporter>
          <assigned_to>kde@gentoo.org</assigned_to>
          <cc>andreas.w.simon@gmail.com</cc>
    
    <cc>andrsd@seznam.cz</cc>
    
    <cc>bdonlan@gmail.com</cc>
    
    <cc>charliecompany@bigfoot.com</cc>
    
    <cc>dju@gentoo.org</cc>
    
    <cc>ed@catmur.co.uk</cc>
    
    <cc>eva@gentoo.org</cc>
    
    <cc>gad.kadosh@gmail.com</cc>
    
    <cc>gentopia@gentoo.org</cc>
    
    <cc>kzimmerm@gentoo.org</cc>
    
    <cc>ladanyi@tmit.bme.hu</cc>
    
    <cc>mafteah@gentoo.org.il</cc>
    
    <cc>marat.buharov@gmail.com</cc>
    
    <cc>mmacleod@ieee.org</cc>
    
    <cc>nzgreen@operamail.com</cc>
    
    <cc>rockoo@gmail.com</cc>
    
    <cc>Sander.Sweers@gmail.com</cc>
    
    <cc>ssuominen@gentoo.org</cc>
    
    <cc>x11@gentoo.org</cc>
    
    <cc>xavier@wuug.org</cc>

      

      
          <long_desc isprivate="0">
            <who>eikke@eikke.com</who>
            <bug_when>2005-01-11 04:16:54 0000</bug_when>
            <thetext>This patch changes GDM&apos;s Xsession in a way a DBUS session daemon is started when a session is started, and stopped when the session is closed.

At this moment not so many programs use the DBUS session daemon, but they&apos;re coming.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>joem@gentoo.org</who>
            <bug_when>2005-01-11 15:20:34 0000</bug_when>
            <thetext>At this point it probably isn&apos;t a good idea to start the session daemon just because the user has dbus installed. It is something that we will need to look into for the future though, as you said more apps will be getting dbus support. Now that portage has the newuse feature, we could maybe add a dbus flag which would add this option.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>eikke@eikke.com</who>
            <bug_when>2005-01-12 02:52:21 0000</bug_when>
            <thetext>Actually that&apos;s what I was thinking off: create the &quot;dbus&quot; USE flag (I&apos;m working on DBUS-izing some applictions these days), and just apply the patch if GDM is emerged with this flag set.
Of course it should dep on sys-apps/dbus too then ;-)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>foser@gentoo.org</who>
            <bug_when>2005-01-12 04:56:43 0000</bug_when>
            <thetext>I&apos;m not in favor of adding/using a dbus flag for trivialities like this, users will want it if it&apos;s used unconditionally. If you don&apos;t have dbus it won&apos;t get started &amp; if you do have it, then gnome will likely use it at some point, but right now there is nothing in the tree that uses a session daemon so thats why I didn&apos;t add it.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kzimmerm@gentoo.org</who>
            <bug_when>2005-01-20 10:19:14 0000</bug_when>
            <thetext>When starting dbus-launch it crashes because of missing the directories /usr/lib/dbus-1.0/service and /usr/lib/dbus-1.0/services.

Maybe the dbus ebuild should take care of this?

kai</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>eikke@eikke.com</who>
            <bug_when>2005-01-20 10:25:36 0000</bug_when>
            <thetext>I guess that&apos;s something wrong at your side. I got a session bus running here all time, with some apps running on it, using latest ~x86 dbus ebuilds. System bus (with hal on it) works great too.
I did notice the Tomboy (I guess it was that one, cant check now caus I copied them over) service description files are installed in some faulty location (ie not the same one as written inside session.conf).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gad.kadosh@gmail.com</who>
            <bug_when>2005-02-04 04:52:25 0000</bug_when>
            <thetext>I can confirm that Ikke&apos;s patch works great. Is it not better to have a /etc/X11/Xsession.d directory with sessions scripts that are sourced by /etc/X11/gdm/Xsession (or whatever). That way the dbus ebuild can put its script in that folder so dbus starts for every new session?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mafteah@gentoo.org.il</who>
            <bug_when>2005-02-16 03:42:56 0000</bug_when>
            <thetext>What about kde users?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ed@catmur.co.uk</who>
            <bug_when>2005-02-16 08:35:16 0000</bug_when>
            <thetext>Re comment 6: there already exists a directory for this purpose, /etc/X11/xinit/xinitrc.d/

I am currently using:

$ cat /etc/X11/xinit/xinitrc.d/30dbus-launch.sh
#!/bin/sh

eval `dbus-launch --sh-syntax --exit-with-session`
export DBUS_SESSION_BUS_ADDRESS
export DBUS_SESSION_BUS_PID

This seems to be the accepted convention; if merged with USE=xprint xorg-x11 puts /etc/X11/xinit/xinitrc.d/92xprint-xpserverlist.sh in that directory.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ed@catmur.co.uk</who>
            <bug_when>2005-02-16 08:36:17 0000</bug_when>
            <thetext>Created an attachment (id=51349)
/etc/X11/xinit/xinitrc.d/30dbus-launch.sh

Much simpler than patching GDM.

This can be installed by the dbus ebuild directly.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gad.kadosh@gmail.com</who>
            <bug_when>2005-02-16 09:06:23 0000</bug_when>
            <thetext>I don&apos;t seem to have a /etc/X11/xinit/xinitrc.d/ directory on my system, though I&apos;m using xorg-6.8.0-r4 and GDM. are you sure about what you are talking about?
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>eikke@eikke.com</who>
            <bug_when>2005-02-16 09:08:10 0000</bug_when>
            <thetext>@Ed: nice catch.
@Gad: I got a dir like that, with some xprint file in it. Maybe you haven&apos;t got the xprint USE flag, and isn&apos;t the directory created by the ebuild?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gad.kadosh@gmail.com</who>
            <bug_when>2005-02-16 09:25:03 0000</bug_when>
            <thetext>indeed the xprint USE flag is not on my system, I will try to create the dir manually to see if it works...

Ikke: it works for you?
I knew of this method in other distros but thought gentoo does not work with it because I didn&apos;t have that dir...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gad.kadosh@gmail.com</who>
            <bug_when>2005-02-16 09:32:45 0000</bug_when>
            <thetext>I just tried that... I created the dir and put the script in it - but dbus is not started.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ed@catmur.co.uk</who>
            <bug_when>2005-02-16 09:38:20 0000</bug_when>
            <thetext>You may need to make it executable. I&apos;ll look to see where they&apos;re sourced from.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ed@catmur.co.uk</who>
            <bug_when>2005-02-16 09:41:00 0000</bug_when>
            <thetext>Yes; gdm sources them thus:

/etc/X11/gdm/Xsession:
# run all system xinitrc shell scripts.
if [ -d /etc/X11/xinit/xinitrc.d ]; then
    for i in /etc/X11/xinit/xinitrc.d/* ; do
        if [ -x &quot;$i&quot; ]; then
      . &quot;$i&quot;
        fi
    done
fi</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gad.kadosh@gmail.com</who>
            <bug_when>2005-02-16 09:51:25 0000</bug_when>
            <thetext>Yes I was hasty. execute made it work - that&apos;s the best fix for it IMO. now it should be added to the dbus ebuild...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>foser@gentoo.org</who>
            <bug_when>2005-03-06 14:02:28 0000</bug_when>
            <thetext>added a session script to 0.23.2-r1 , please cheack &amp; test.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>foser@gentoo.org</who>
            <bug_when>2005-03-07 04:47:48 0000</bug_when>
            <thetext>according to spyderous xinitrc.d is a RH-ism we don&apos;t really support, so we really shouldn&apos;t be using it.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ed@catmur.co.uk</who>
            <bug_when>2005-03-07 04:59:27 0000</bug_when>
            <thetext>Is there an alternative? I note that xorg-x11+xprint installs 92... to both /etc/X11/xinit/xinitrc.d and /etc/X11/Xsession.d - should dbus do the same?

wrt comment 17, shouldn&apos;t the session script export the variables?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>foser@gentoo.org</who>
            <bug_when>2005-03-07 05:34:45 0000</bug_when>
            <thetext>There is no alternative to our knowledge.

the --sh-syntax should already do the exporting, it seemed redundant to me.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>eikke@eikke.com</who>
            <bug_when>2005-03-07 06:08:41 0000</bug_when>
            <thetext>--sh-syntax doesnt do the exporting itself, it only printf()&apos;s the variables you should export in a SH-compliant way (theres also the --csh-syntax flag). So depending on the place where you call it, eval()&apos;ing it can be necessary.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gad.kadosh@gmail.com</who>
            <bug_when>2005-03-07 10:23:05 0000</bug_when>
            <thetext>does this solution work with GDM only or all others login managers? does it affect startx too?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>nzgreen@operamail.com</who>
            <bug_when>2005-03-28 23:01:32 0000</bug_when>
            <thetext>This script does not kill my session daemon when I log out of GNOME.  Does it do that for anyone else?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>nzgreen@operamail.com</who>
            <bug_when>2005-04-02 13:48:15 0000</bug_when>
            <thetext>Adding myself to CC list.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>andreas.w.simon@gmail.com</who>
            <bug_when>2005-05-12 02:37:47 0000</bug_when>
            <thetext>Answer to comment #22:
No this script doesn&apos;t work with kdm or xdm because their various Xsession scripts doesn&apos;t source the scripts in /etc/X11/xinit/xinitrc.d/ , i.e. they miss the code snipplet from comment #15.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>neosimago@yahoo.com</who>
            <bug_when>2006-03-21 19:11:26 0000</bug_when>
            <thetext>(In reply to comment #8)
&gt; Re comment 6: there already exists a directory for this purpose,
&gt; /etc/X11/xinit/xinitrc.d/
&gt; 
&gt; I am currently using:
&gt; 
&gt; $ cat /etc/X11/xinit/xinitrc.d/30dbus-launch.sh
&gt; #!/bin/sh
&gt; 
&gt; eval `dbus-launch --sh-syntax --exit-with-session`
&gt; export DBUS_SESSION_BUS_ADDRESS
&gt; export DBUS_SESSION_BUS_PID
&gt; 
&gt; This seems to be the accepted convention; if merged with USE=xprint xorg-x11
&gt; puts /etc/X11/xinit/xinitrc.d/92xprint-xpserverlist.sh in that directory.
&gt; 

I don&apos;t have the same file, but i do have the 30-dbus file. So integrating the two, i get: 

[code]

BeTaBoXjFS xinitrc.d # cat 30-dbus
#!/bin/bash

# launches a session dbus instance

dbuslaunch=&quot;`which dbus-launch 2&gt;/dev/null`&quot;

if [ -n &quot;$dbuslaunch&quot; ] &amp;&amp; [ -x &quot;$dbuslaunch&quot; ] &amp;&amp; [ -z &quot;$DBUS_SESSION_BUS_ADDRESS&quot; ]; then

  eval `$dbuslaunch --sh-syntax --exit-with-session`

# added from http://bugs.gentoo.org/show_bug.cgi?id=77504

        export DBUS_SESSION_BUS_ADDRESS
        export DBUS_SESSION_BUS_PID
#

fi

[/code]

Hope it helps!</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>eva@gentoo.org</who>
            <bug_when>2006-06-12 23:51:22 0000</bug_when>
            <thetext>what is the status of this bug ?
I have the script installed (running ~x86) and the session bus is launched and stopped the right way.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cardoe@gentoo.org</who>
            <bug_when>2006-06-17 08:04:28 0000</bug_when>
            <thetext>We include this script now. Gnome works fine for a while... other WMs work fine if they process the xinitrc.d dir... I think only KDE is busted..

&lt;genstef&gt; ln -s /etc/X11/xinit/xinitrc.d/30-dbus /usr/kde/3.5/env/dbus.sh
&lt;genstef&gt; basically that is needed
&lt;Flameeyes&gt; genstef, i&apos;m not sure if that is correct
&lt;genstef&gt; use hal &amp;&amp; dosym /etc/X11/xinit/xinitrc.d/30-dbus ${KDEDIR}/env/dbus.sh
&lt;genstef&gt; why not?
* zzam has quit (&quot;KVIrc 3.2.3 Anomalies http://www.kvirc.net/&quot;)
&lt;Cardoe&gt; Flameeyes: the correct thing is for KDE to process xinit stuff
&lt;Flameeyes&gt; Cardoe, exactly my point
&lt;sekretarz&gt; Cardoe: if you can check it i&apos;d be apriciate
&lt;Cardoe&gt; however for now... Gentoo needs to do the hack
&lt;Flameeyes&gt; Cardoe, i suppose it&apos;s quite simpler to change the other thing
&lt;Flameeyes&gt; startkde script is the one to fix
* mabi (n=mabi@p54B878FA.dip.t-dialin.net) has joined #gentoo-dev
&lt;Flameeyes&gt; i think i can do that easily, but i&apos;m not sure if carlo has put the patches for the tarballs in CVS, so he might be the only one able to prepare them correctly

That&apos;s the revelant part of the discussion.

Re-assigning to KDE herd since it&apos;s waiting on them now.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>flameeyes@gentoo.org</who>
            <bug_when>2006-06-17 08:10:36 0000</bug_when>
            <thetext>I have a patch that should work, waiting for genstef to test (I can&apos;t right now), and then I&apos;ll commit it.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dberkholz@gentoo.org</who>
            <bug_when>2006-06-20 22:39:01 0000</bug_when>
            <thetext>*** Bug 132782 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>compnerd@gentoo.org</who>
            <bug_when>2006-06-28 00:34:14 0000</bug_when>
            <thetext>*** Bug 138101 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cardoe@gentoo.org</who>
            <bug_when>2006-06-30 07:14:29 0000</bug_when>
            <thetext>Flameyes and genstef have fixed this issue.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>marat.buharov@gmail.com</who>
            <bug_when>2006-09-13 03:33:31 0000</bug_when>
            <thetext>it is not work for launching gnome from startx (not using gdm)

solution:
add this code to /etc/X11/xinit/xinitrc

# run all system xinitrc shell scripts.
if [ -d /etc/X11/xinit/xinitrc.d ]; then
    for i in /etc/X11/xinit/xinitrc.d/* ; do
        if [ -x &quot;$i&quot; ]; then
      . &quot;$i&quot;
        fi
    done
fi</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cardoe@gentoo.org</who>
            <bug_when>2006-09-13 16:10:49 0000</bug_when>
            <thetext>It should be started by the Gnome Session script.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dberkholz@gentoo.org</who>
            <bug_when>2006-09-13 19:32:54 0000</bug_when>
            <thetext>Someone&apos;s working with me on a more generalized solution now (see -dev list xinit thread), it&apos;ll probably be a while before we can get where it needs to be.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>51349</attachid>
            <date>2005-02-16 08:36 0000</date>
            <desc>/etc/X11/xinit/xinitrc.d/30dbus-launch.sh</desc>
            <filename>30dbus-launch.sh</filename>
            <type>text/plain</type>
            <data encoding="base64">IyEvYmluL3NoCgpldmFsIGBkYnVzLWxhdW5jaCAtLXNoLXN5bnRheCAtLWV4aXQtd2l0aC1zZXNz
aW9uYApleHBvcnQgREJVU19TRVNTSU9OX0JVU19BRERSRVNTCmV4cG9ydCBEQlVTX1NFU1NJT05f
QlVTX1BJRAo=
</data>        

          </attachment>
    </bug>

</bugzilla>