0

We've enabled systemd --user on our servers, and now users can manipulate their services themselves.

When a user foo logs-in directly, things like systemctl --user status work as expected -- foo's own services are listed. So far so good.

However, when another user -- bar -- switches identity to foo using sudo (or ksu), the same command prints a D-BUS connection-failure error...

I suspect, some environment variable remains pointing at bar -- instead of foo -- even after the identity-change, but I cannot figure out, which one...

How do we work around this problem? Using RHEL7 here, if it matters...

  • 3
    Does this answer your question? https://unix.stackexchange.com/a/615964/272848 – Stewart Feb 05 '21 at 19:01
  • Yes, it does, thank you!.. Now, why wouldn't sudo and ksu take care of that particular environment variable -- XDG_RUNTIME_DIR -- and how should one deal with it?.. Sigh... – Mikhail T. Feb 10 '21 at 03:25

0 Answers0