4

I'm running systemd-231 on Arch Linux.

When I log in, systemd starts a dbus, but it seems there is some problem with gvfs interacting with that dbus. If I start a dbus in a terminal the new dbus seems to work fine.

» systemctl --user status dbus.service
● dbus.service - D-Bus User Message Bus
   Loaded: loaded (/usr/lib/systemd/user/dbus.service; static; vendor preset: enabled)
   Active: active (running) since Mon 2016-09-05 20:51:05 BST; 40min ago
     Docs: man:dbus-daemon(1)
 Main PID: 3188 (dbus-daemon)
   CGroup: /user.slice/user-1034.slice/[email protected]/dbus.service
           ├─3188 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation
           └─3288 /usr/lib/GConf/gconfd-2

Sep 05 21:17:50 a-host dbus-daemon[3188]: Failed to activate service 'org.gtk.vfs.Daemon': timed out
Sep 05 21:17:50 a-host dbus-daemon[3188]: Failed to activate service'org.freedesktop.systemd1': timed out

calls to gvfs seem to be affected by the gvfs-daemon timeout.

e.g.

» gvfs-ls /tmp    # long wait before output

(gvfs-ls:12745): GVFS-WARNING **: Error creating proxy: Error calling StartServiceByName for org.gtk.vfs.Daemon: Timeout was reached (g-io-error-quark, 24)

systemd-private-0c85dfd7446c421ba74be6bfb562fc0e-systemd-timesyncd.service-8EY8dZ

The D-Bus address seems to be set correctly:

» echo $DBUS_SESSION_BUS_ADDRESS
unix:path=/run/user/1034/bus

If I start a dbus in the terminal, that dbus seems to be able to activate the various gvfs services and I get no timeouts:

» eval `dbus-launch --sh-syntax`

» echo $DBUS_SESSION_BUS_ADDRESS
unix:abstract=/tmp/dbus-iDDJAPUedN,guid=073a15321e1588b8db0a42f057cdd80d

» gvfs-ls /tmp # runs instantly
systemd-private-0c85dfd7446c421ba74be6bfb562fc0e-systemd-timesyncd.service-8EY8dZ

Why does dbus not activate correctly with the systemd dbus?

sw1nn
  • 163
  • 1
  • 9
  • I'm having the same problem. I suspect that systemd and gvfs are using different session buses, which makes systemd not see that gvfs has acquired the org.gtk.vfs.Daemon name, thus the timeout. – Simon Kohlmeyer Sep 21 '16 at 23:40
  • After monitoring the session bus with `dbus-monitor` while trying `systemctl --user start gvfs-daemon`, I'm now pretty certain that gvfsd does indeed start, and systemd just doesn't see it. – Simon Kohlmeyer Sep 22 '16 at 00:03
  • I opened an issue for this: https://bugs.archlinux.org/task/50871 – Simon Kohlmeyer Sep 22 '16 at 17:02
  • @SimonKohlmeyer I see that you're using i3, so am I, not sure it's relevant. This gvfs timeout seems to be common when you have a bad polkit installation and/or setup, which might be the case if using a simple wm setup. I wonder if there is something wrong with polkit (and related authentication agent) and that's what's causing this issue. For the record - I've tried tried directly on a console with no X11 and the issue still occurs. I don't know how to debug further. – sw1nn Sep 23 '16 at 11:04
  • Any links would be nice. I don't really get how polkit would be involved, everything related (systemd, dbus, gvfs) runs as my unprivileged user. – Simon Kohlmeyer Sep 23 '16 at 11:53

1 Answers1

1

This was caused by the presence of a 'drop-in' file /etc/systemd/system/[email protected]/dbus.conf that overrode the 'standard' definition of the [email protected] from /usr/lib/systemd/system and in particular changed the DBUS_SESSION_BUS_ADDRESS

How that drop-in file got there is still a mystery. According to pacman -Qo it wasn't owned by any package. I assume that some package added it and then it wasn't removed properly in a subsequent update. Not sure.

After removing the /etc/systemd/system/[email protected]/dbus.conf file everything seems to work fine.

sw1nn
  • 163
  • 1
  • 9