12

I get this error when running any systemd command as a user:

admin@Xroklaus:~ $ systemctl --user list-units Failed to get D-Bus connection: Connection refused 

Without the user parameter, the command runs fine.

admin@Xroklaus:~ $ systemctl list-units UNIT LOAD ACTIVE SUB DESCRIPTION proc-sys-fs-binfmt_misc.automount loaded active waiting Arbitrary Executable File Formats File System Automount Point sys-devices-platform-soc-3f201000.serial-tty-ttyAMA0-hci0-rfkill1.device loaded active plugged /sys/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0/rfkil sys-devices-platform-soc-3f201000.serial-tty-ttyAMA0-hci0.device loaded active plugged /sys/devices/platform/soc/3f201000.serial/tty/ttyAMA0/hci0 ... To show all installed unit files use 'systemctl list-unit-files'. lines 102-129/129 (END) 

And Dbus is running.

admin@Xroklaus:~ $ ps -ef | grep dbus message+ 443 1 0 Jan06 ? 00:00:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation admin 9082 9040 0 11:42 pts/0 00:00:00 grep --color=auto dbus 

Systemd does not appear to be running for this user

admin@Xroklaus:~ $ ps -ef | grep systemd root 142 1 0 Jan06 ? 00:00:08 /lib/systemd/systemd-journald root 147 1 0 Jan06 ? 00:00:00 /lib/systemd/systemd-udevd message+ 443 1 0 Jan06 ? 00:00:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation root 520 1 0 Jan06 ? 00:00:00 /lib/systemd/systemd-logind admin 10255 9040 0 16:53 pts/0 00:00:00 grep --color=auto systemd 

I don't know how to get it running though.

This seems not normal either:

admin@Xroklaus:~ $ systemd --test Trying to run as user instance, but $XDG_RUNTIME_DIR is not set. 
2
  • 1
    Do you have a dbus instance running for your own user? And most important do you have a systemd instance running for your user? Commented Jan 7, 2018 at 12:05
  • 2
    Sadly this is disabled for RHEL/CentOS 7 bugs.centos.org/view.php?id=8767 Commented Jul 4, 2018 at 3:46

1 Answer 1

8

Looks like a package went missing:

admin@Xroklaus:~ $ sudo apt-get install libpam-systemd 

And after a reboot it works again.

1
  • Reboot required for me (Raspbian). Thanks for this tip. Commented Jan 26, 2019 at 18:26

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.