-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
User session forcefully ended after logind restart #16146
Copy link
Copy link
Closed
Description
systemd 245.6
Used distribution
PLD Linux
Expected behaviour you didn't see
User sessions continue to work after logind restart.
Unexpected behaviour you saw
User session is forcefully finished approximately after 5min since logind restart.
Steps to reproduce the problem
Restart systemd-logind.
As far as I understand code logind saves its state in /run/systemd/users where each file has name equal to user UID. However instead of calling manager_add_user_by_uid it calls manager_add_user_by_name. In the latter case VALID_USER_ALLOW_NUMERIC is not passed to valid_user_group_name, only VALID_USER_RELAX.
static int manager_enumerate_users(Manager *m) {
...
/* Read in user data stored on disk */
d = opendir("/run/systemd/users");
if (!d) {
if (errno == ENOENT)
return 0;
return log_error_errno(errno, "Failed to open /run/systemd/users: %m");
}
FOREACH_DIRENT(de, d, return -errno) {
User *u;
if (!dirent_is_file(de))
continue;
k = manager_add_user_by_name(m, de->d_name, &u);
if (k < 0) {
r = log_warning_errno(k, "Failed to add user by file name %s, ignoring: %m", de->d_name);Logs:
cze 11 14:15:11 pine systemd[1]: Starting Login Service...
cze 11 14:15:11 pine systemd-logind[1672]: New seat seat0.
cze 11 14:15:11 pine systemd-logind[1672]: Failed to add user by file name 1000, ignoring: Invalid argument
cze 11 14:15:11 pine systemd-logind[1672]: User enumeration failed: Invalid argument
cze 11 14:15:11 pine systemd-logind[1672]: User of session c2 not known.
cze 11 14:15:11 pine systemd-logind[1672]: Session enumeration failed: No such file or directory
....
cze 11 14:20:18 pine systemd[1]: Stopping User Manager for UID 1000...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels