Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How should I connect to user dbus session?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Fri Apr 06, 2012 4:47 pm    Post subject: How should I connect to user dbus session? Reply with quote

A recent upgrade of dbus has resulted in the following for me.

1. Login to X as user, I used slim with the default session that opens up only a terminal for me.

2. Run the following:
Code:
~> qdbus org.freedesktop.DBus  # This works, running as user.
/
~> su -
Password:
~> qdbus org.freedesktop.DBus  # This is running as root and it works.
/
~> su <user> -c 'qdbus org.freedesktop.DBus'  # Fails
Could not connect to D-Bus server: org.freedesktop.DBus.Error.Spawn.ExecFailed: /usr/bin/dbus-launch terminated abnormally with the following error: No protocol specified
Autolaunch error: X11 initialization failed.

~ [1] > su <user> -c 'DISPLAY=:0.0  qdbus org.freedesktop.DBus' # Fails
Could not connect to D-Bus server: org.freedesktop.DBus.Error.Spawn.ExecFailed: /usr/bin/dbus-launch terminated abnormally with the following error: No protocol specified
Autolaunch error: X11 initialization failed.


3. The latter commands used to work. For years. And I used the dbus service like this daily via an acpi script. It stopped working after the upgrade of dbus to 1.4.18. The previous version of dbus where it worked was 1.4.16.

4. A downgrade of dbus to 1.4.16 has not restored the earlier behavior.


So, now my question is this: what is the newfangled way to get commands like the above to work? These things used to "just work" for so many years. :roll:
_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Back to top
View user's profile Send private message
cosmoslx
n00b
n00b


Joined: 15 Jun 2011
Posts: 1

PostPosted: Wed Dec 12, 2012 3:26 am    Post subject: Reply with quote

I also have this problem too...
have you figured out the solution yet?
Back to top
View user's profile Send private message
salahx
Guru
Guru


Joined: 12 Mar 2005
Posts: 530

PostPosted: Thu Dec 13, 2012 5:57 am    Post subject: Reply with quote

I suspect the problem has to do with the way dbus autolaunches, on autolaunch it checks for a existing bus (by checking DBUS_SESSION_BUS_ADDRESS - if that's not set it check ~/.dbus/session-bus). The problem is ~/.dbus/session-bus contains stale data. The solution is not to rely on autolaunch but explicitly create the bus yourself: eval `dbus-launch --sh-syntax`. Do note however, the resulting dbus will NOT be automatically terminated on logout
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum