Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have systemd set up so that using systemctl start user@me will start my user services as I expect, but my dbus one just won't go (which I need for PulseAudio).

Is there some way I can check dbus or systemd to figure out what I'm doing wrong?

At this point I'm out of ideas for things to try. Please let me know if there's anything else I can provide that might be relevant.


Additional Info/Resolution Attempt

I'm using Arch Linux, systemd 204-1, and dbus 1.6.10-1

Starting user systemd through # systemctl start user@me gives me this:

├─systemd─┬─(sd-pam)
│         ├─mpd───5*[{mpd}]
│         └─pulseaudio─┬─gconf-helper
│                      └─2*[{pulseaudio}]

Starting systemd --user & manually as my user produces:

├─bash─┬─pstree
│      └─systemd─┬─2*[dbus-daemon]
│                ├─dbus-launch <<< X only
│                ├─gconfd-2    <<< X only
│                ├─mpd───5*[{mpd}]
│                └─pulseaudio─┬─gconf-helper
│                             └─2*[{pulseaudio}]

And spits out the following error if I'm not in X, despite the fact that I did enable my user dbus.service:

Failed to open private bus connection: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Failed to open private bus connection: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11

Related Links:

  1. http://superuser.com/questions/476379/how-do-i-setup-a-systemd-service-to-be-started-by-a-non-root-user-as-a-user-daem
  2. https://github.com/sofar/user-session-units
  3. https://github.com/grawity/systemd-user-units

The first two mention a problem with dbus, but at link 2 it says that the problem is fixed in dbus-1.6.9, so I think the problem is with my implementation rather than this bug.

I used example user services from links 2 & 3.

share|improve this question

3 Answers 3

Have you tried using user-session@.service instead of user@.service. I had problems with user@.service in the beginning, (don't know anymore which exactly) and after switching it worked.

It's in the second repo you linked. This unit sets the DISPLAY variable to :0. It won't work with multiple displays, but works fine for me with one.

share|improve this answer

If not using X with dbus,

You can set this environment variable in order to tell dbus which bus session to use :

export DBUS_SESSION_BUS_ADDRESS=

Hope this help!

share|improve this answer

If DBUS_SESSION_BUS_ADDRESS is not set for a process that tries to use D-Bus, by default that process will attempt to invoke dbus-launch with the --autolaunch option to start up a new session bus or find the existing bus address on the X display or in a file in ~/.dbus/session-bus/.

When dbus is not being used with Xorg, as much in the same manner as $DISPLAY works to use a different server, you can set this environment variable in order to tell dbus which bus session to use:

export DBUS_SESSION_BUS_ADDRESS=""

For more info, read http://dbus.freedesktop.org/doc/dbus-launch.1.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.