View previous topic :: View next topic |
Author |
Message |
ppurka Advocate
Joined: 26 Dec 2004 Posts: 3256
|
Posted: Fri Apr 06, 2012 4:47 pm Post subject: How should I connect to user dbus session? |
|
|
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. _________________ emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/ |
|
Back to top |
|
|
cosmoslx n00b
Joined: 15 Jun 2011 Posts: 1
|
Posted: Wed Dec 12, 2012 3:26 am Post subject: |
|
|
I also have this problem too...
have you figured out the solution yet? |
|
Back to top |
|
|
salahx Guru
Joined: 12 Mar 2005 Posts: 530
|
Posted: Thu Dec 13, 2012 5:57 am Post subject: |
|
|
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 |
|
|
|