[Cialug] systemctl user ; environment variables

Todd Walton tdwalton at gmail.com
Mon Mar 14 18:14:57 UTC 2022


I have a problem. I can't run systemctl --user. I get an error about
environment variables not being set.

$ systemctl --user
Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR
not defined

Both of those *are* defined. I can echo them and if I run 'export -p'
they're listed as being defined *and* exported. So systemctl should be
seeing them.

$ export -p | grep -P "(XDG_RUNTIME_DIR|DBUS_SESSION_BUS_ADDRESS)"
declare -x DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"
declare -x XDG_RUNTIME_DIR="/run/user/1000"

If I set the machine argument to systemctl, i.e. 'systemctl --user
--machine=todd at .host status', it works.

What do you figure might be causing this problem?

--
Todd


More information about the Cialug mailing list