Linux – Why does gvfs with systemd dbus timeout

arch linuxd-busgvfssystemd

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/user@1034.service/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?

Best Answer

This was caused by the presence of a 'drop-in' file /etc/systemd/system/user@.service.d/dbus.conf that overrode the 'standard' definition of the user@.service 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/user@.service.d/dbus.conf file everything seems to work fine.

Related Question