github.com/linuxmint/systemd-betsy commit-hash f7ab85f1e1169ac1598dfc1fba1c01063840b3c5 Orignal Commit Author: https://github.com/clefebvre =================================================================== --- elogind-234.4.orig/src/login/pam_elogind.c +++ elogind-234.4/src/login/pam_elogind.c @@ -463,6 +463,15 @@ if (r != PAM_SUCCESS) return r; } + else { + if (pw->pw_uid == 0) { + r = pam_misc_setenv(handle, "XDG_RUNTIME_DIR", "/run/user/0", 0); + if (r != PAM_SUCCESS) { + pam_syslog(handle, LOG_ERR, "Failed to set runtime dir for UID 0."); + return r; + } + } + } if (!isempty(seat)) { r = pam_misc_setenv(handle, "XDG_SEAT", seat, 0);