[Qt-interest] QDBusConnection::sessionBus isn't connected when no X started
Thiago Macieira
thiago.macieira at trolltech.com
Sat May 9 10:48:45 CEST 2009
michael kapelko wrote:
>Hello.
>Running QDBusConnection::sessionBus under a user with no X started
>yields the following QDBusError:
>'dbus-launch failed to autolaunch D-Bus session: Autolaunch error: X11
>initialization failed'.
>When running under a user with X started, everything's just fine.
>I need to run an application as a daemon under a user (root) with no X
> started. Running 'dbus-launch ./myapp' does not solve anything as it
> creates a new session bus for that application only, whereas I want to
> access "global" D-Bus to:
>1) run only a single instance of the app;
>2) control the running instance through invoking switches: './myapp
>--reloadConfig' (for use in scripts).
>How to solve the problem?
There's no "global" session bus in D-Bus.
If you're using a session bus, it's per user and needs to be started
manually if X isn't running.
However, there's the system bus (which is global). In that case, you use
QDBusConnection::systemBus. Note that you must modify /etc/dbus-1/system.d
to allow yourself to own the name you're trying to own.
--
Thiago Macieira - thiago.macieira (AT) nokia.com
Senior Product Manager - Nokia, Qt Software
Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090509/b6614cef/attachment.bin
More information about the Qt-interest-old
mailing list