On Monday 07 April 2008, Craig Millar said:
I have a couple of queries about qdbus.
Why does qdbus need an available X session to run? I noticed this on a remote ssh session to my home box.
craig@pablo:~> qdbus org.ktorrent.ktorrent /KTorrent \ org.ktorrent.KTorrent.torrents Could not connect to D-Bus server: org.freedesktop.DBus.Error.Spawn.ExecFailed: dbus-launch failed to autolaunch D-Bus session: Autolaunch error: X11 initialization failed.
This is resolved if I ssh -X but it still strikes me as odd. Then the second problem that I have is that I can't seem to work out how to connect to another existing session (kde session logged in as myself this morning).
It doesn't need absolutely need an X session. It first looks in DBUS_SESSION_BUS_ADDRESS. If this isn't set it will try to run dbus-launch --autostart to determine the address by querying another X window... which is session dependent.
craig@pablo:~> qdbus org.ktorrent.ktorrent /KTorrent \ org.ktorrent.KTorrent.torrents Service 'org.ktorrent.ktorrent' does not exist.
But I know that it does exist - I just can't work our how to use the other session - a simple invocation of qdbus gives me this:
craig@pablo:~> qdbus
:1.1
You're talking on the wrong bus. KTorrent doesn't exist on the bus in DBUS_SESSION_BUS_ADDRESS then. You can copy the value of that from another environment then you should be talking on the right bus. I guess you are trying to remotely control a ktorrent instance over an SSH session. The first time it didn't work because there was no bus address and no way to get one, the second time you got the address of the session bus of your local session. You could try saving the value of DBUS_SESSION_BUS_ADDRESS when you start ktorrent to a file and then setting it after you ssh in. Let us know how you get on, with dcop all this was easy^Waround for years and well known. Will -- Desktop Engineer KDE Team -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org