Dealing with the nasty session D-Bus connection "bug"

Questions specific to the KDE DE go here
User avatar
Snap
Posts: 1244
Joined: 25 Aug 2013 20:01
Location: Spain

Dealing with the nasty session D-Bus connection "bug"

Postby Snap » 22 Aug 2015 17:55

This "bug" has been hitting KDE users for quite some time typically affecting Kate and Klipper amongst other apps. The KDE developers blame Qt and say that it should be harmless. I didn't bothered to check what the Qt devs say about it. In any case, this problem has being around for a long while. I specially hate not being able to open a text file in Kate from a kdesudoed Dolphin. Tired of this, I started to search for a solution or a workaround once again.

Why I say "bug"? Because IMHO it's not a bug. It's a configuration problem. Why? Because you normally find complaints from Ubuntu, Linux Mint, and other Debian and Buntu derivatives including SolydXK. I hardly ever found a complain from a KDE Arch user, and I think never once from a PCLinuxOS user. So, hard to believe it's a bug.

For starters I replicated the problematic actions in my PCLinuxOS virtual machines. Not a single problem and the typical message:

Code: Select all

QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
we use to see if launching apps from a terminal (or checking the ~/.xsession-errors file) doesn't appear anywhere. So where's the bug? in KDE? in Qt? Nope. I don't think so.

My first attempt to overcome the issue in SolydK was trying to force relaunch dbus after login. It worked. This led me to explore the PCLinuxOs xinit configs. Found they use an init.d directory (we don't have) and inside it (amongst others) there's a file called 30dbus. Interesting, isn't it? Checked the Arch Wiki and the arch way confirms that use too. So why not to try?

Code: Select all

sudo mkdir /etc/X11/xinit/xinitrc.d

Code: Select all

sudo touch /etc/X11/xinit/xinitrc.d/30-dbus

Code: Select all

sudo nano /etc/X11/xinit/xinitrc.d/30-dbus
Then add this to the file to source dbus for xinit:

Code: Select all

# to be sourced
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
  eval `/usr/bin/dbus-launch --exit-with-session --sh-syntax`
fi
Save, close and make it executable:

Code: Select all

sudo chmod a+x /etc/X11/xinit/xinitrc.d/30-dbus
Reboot, login et voila! Conflictive apps now perform normally and I can launch anything from a kdesudoed Dolphin instance. The harmless(?) QDBusConnection message is still there. But the xinit config did the job.

Next step: keep checking the PCLinuxOS KDE configs and try to find how to kill that damned message. Or in other words; making dbus to behave as it should. I'll post back if I find it.

Cheers.
This likely means that your installation is broken. -Mr Pixbuf.

Image

User avatar
grizzler
Posts: 2197
Joined: 04 Mar 2013 15:45
Location: The Hague, NL

Re: Dealing with the nasty session D-Bus connection "bug"

Postby grizzler » 22 Aug 2015 18:49

My SolydX (Stretch) has a file /etc/X11/xinit/xinitrc.d/50-systemd-user.sh which contains:

Code: Select all

#!/bin/sh

systemctl --user import-environment DISPLAY XAUTHORITY
I copied that directory/file to one of my SolydK (Jessie) VMs and that did the job. Opening any text file or script with Kate from a Dolphin started with kdesudo worked without problems. I did get the QDBusConnection message in .xsession-errors, though. But .xsession-errors fills up with all kinds of useless messages anyway, so I wouldn't let that bother me.
Frank

SolydX EE 64 - tracking Debian Testing

User avatar
Snap
Posts: 1244
Joined: 25 Aug 2013 20:01
Location: Spain

Re: Dealing with the nasty session D-Bus connection "bug"

Postby Snap » 22 Aug 2015 20:09

Thanks, grizzler, Good to know an alternative method too.

Nevertheless, the init.d way is init system agnostic. This other method is systemd exclusive. Of course it applies to SolydXK (though systemd is not an init system anymore).
.xsession-errors fills up with all kinds of useless messages anyway
Yup, like complaining about not finding locales that I purged with localepurge or the damned phonon complaining about not finding pulseaudio which I also purged completely. I never understood why phonon has to be necessarily in the way. If you use alsa and/or Jack it's an useless and annoying bit of code always complaining about the soundcards it cannot manage anymore. I'll have to find a way to disable it. But the important errors are there too. it's a nice file to sort out problems along with the /var/log stuff.
This likely means that your installation is broken. -Mr Pixbuf.

Image


Return to “KDE specific (SolydK)”

Who is online

Users browsing this forum: No registered users and 2 guests