[systemd-devel] [RFE] systemctl --user should work as expected after su --login USER

Gena Makhomed gmm at csdoc.com
Fri Jan 8 21:04:42 UTC 2021


Hello, All!

User www exists, linger enabled, but "systemctl --user"
not work as expected after command "su --login www":

# su --login www
$ systemctl --user
Failed to connect to bus: No such file or directory

Feature request:
================

After starting systemctl, if XDG_RUNTIME_DIR environment variable
not exists and directory "/run/user/$(id -u)" exists and directory 
"/run/user/$(id -u)" has permission 0700 and owner of current user
- systemctl should set environment variable XDG_RUNTIME_DIR
in own environment to /run/user/$(id -u) at very beginning.

This will be solution for running systemctl --user
after switching user by command "su --login $USER"


Existing workarounds:
=====================

Put

XDG_RUNTIME_DIR=/run/user/$(id -u)
export XDG_RUNTIME_DIR

to file /etc/profile.d/xdg-runtime-dir.sh


Existing bugreports:
====================

https://bugzilla.redhat.com/show_bug.cgi?id=1531890
https://bugzilla.redhat.com/show_bug.cgi?id=753882


Existing manuals:
=================
https://access.redhat.com/solutions/4661741

-- 
Best regards,
  Gena


More information about the systemd-devel mailing list