Logging out does not decrease the number of logged in users
Running GDM/GNOME 3.28 on Ubuntu 18.04.
Not sure if this is the right place to post this however, but since it has to do with logout/login, I took a chance.
- Boot the system, login.
uptime
shows 1 logged user.
- Logout from GNOME and login again:
uptime
shows 2 logged users, instead of 1.
- Logout from GNOME and login again:
uptime
shows 3 logged users, instead of 1.
And repeating the process shows the same results, incrementing the number by 1 each time.
I tried digging a bit into procps to see what this number came from:
in procps/proc/whattime.c:
/* count the number of users */
numuser = 0;
setutent();
while ((utmpstruct = getutent())) {
if ((utmpstruct->ut_type == USER_PROCESS) &&
(utmpstruct->ut_name[0] != '\0'))
numuser++;
}
endutent();
This led me to glibc/login/getutent.c, but now I have no idea what I'm looking at..
Is it possible that GDM (or GNOME..) leaves a trail after a user logs out? Something that would make procps count logged out users?