You are not logged in.

#1 2014-01-31 15:53:59

gegenschall
Member
From: Munich, Germany
Registered: 2013-10-09
Posts: 33

DBUS_SESSION_BUS_ADDRESS set to the "wrong" value

Hi all,

this is related to systemctl --user stuff but only remotely. I had systemctl --user up and running for some time, but it stopped working at some point with a message  "Failed to issue method call: Process /bin/false exited with status 1". After searching a bit I figured it had something to do with dbus, so I added the following unit files:

/etc/systemd/user/dbus.service

[Unit]
Description=D-Bus Message Bus
Requires=dbus.socket

[Service]
ExecStart=/usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation
ExecReload=/usr/bin/dbus-send --print-reply --session --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig

/etc/systemd/user/dbus.socket

[Unit]
Description=D-Bus Message Bus Socket
Before=sockets.target

[Socket]
ListenStream=/run/user/%U/dbus/user_bus_socket

[Install]
WantedBy=default.target

which basically gives me a user-session dbus socket in /run/user/1000/dbus/user_bus_socket. So far so good.

What's troubling me is that DBUS_SESSION_BUS_ADDRESS is set to a non-existing socket:

max@failenovo:~/ $ echo $DBUS_SESSION_BUS_ADDRESS
unix:abstract=/tmp/dbus-st1aYMhS1t,guid=bdc7f9102f85b8318ba74ffe52ebc3dd
max@failenovo:~/ $ file /tmp/dbus-st1aYMhS1t
/tmp/dbus-st1aYMhS1t: cannot open `/tmp/dbus-st1aYMhS1t' (No such file or directory)

So, invoking systemd --user gives me: "Failed to issue method call: Process org.freedesktop.systemd1 exited with status 1". If I manually export DBUS_SESSION_BUS_ADDRESS to the correct value from the dbus.socket unit, it works:

max@failenovo:~/ $ systemctl --user
Failed to issue method call: Process org.freedesktop.systemd1 exited with status 1
max@failenovo:~/ $ DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/dbus/user_bus_socket systemctl --user 
max@failenovo:~/ $ echo $?
0

My two questions:

  • How would I confiugure dbus-daemon (launched by gnome-session, I guess) to _actually write_ out the dbus socket in /tmp?

  • OR: Where's the best place to manually set the DBUS_SESSION_BUS_ADDRESS to a value, so that it doesn't get overwritten by garbage?

Cheers,
Max

Offline

#2 2014-02-02 14:42:00

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: DBUS_SESSION_BUS_ADDRESS set to the "wrong" value

have you tried this? https://bbs.archlinux.org/viewtopic.php?id=173501

Since version 207, systemd uses a different PAM module for user@.service, and includes an incorrect default PAM config. Fix it with: # sed -i s/system-auth/system-login/g /etc/pam.d/systemd-user (or replace all occurrences of system-auth in that file with system-login).
system-login needs to start pam_systemd: it should contain -session optional pam_systemd.so; check if a .pacnew file exists.


no place like /home
github

Offline

#3 2014-02-02 17:38:57

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: DBUS_SESSION_BUS_ADDRESS set to the "wrong" value

@demian, that little sed replacement is no longer relevant or necessary.  It has since been changed in systemd 208.

Offline

#4 2014-02-03 10:31:55

gegenschall
Member
From: Munich, Germany
Registered: 2013-10-09
Posts: 33

Re: DBUS_SESSION_BUS_ADDRESS set to the "wrong" value

I'm pretty sure that my /etc/pam.d/* files are doing the right thing (they're vanilla). Lauching the systemd user instance is not really the problem, it actually works. I just can't run "systemctl --user" to control it without prepending/overwriting DBUS_SESSION_BUS_ADDRESS.

Offline

#5 2014-02-03 16:02:39

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: DBUS_SESSION_BUS_ADDRESS set to the "wrong" value

Offline

#6 2014-02-03 17:20:27

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: DBUS_SESSION_BUS_ADDRESS set to the "wrong" value

gegenschall wrote:

DBUS_SESSION_BUS_ADDRESS is set to a non-existing socket

That's OK because it's "abstract". Apparently.

Offline

Board footer

Powered by FluxBB