I tested this on focal 20.4.4 LTS. I used lightdm version 1.30.0-0ubuntu4~20.04.2.
How to reproduce.
install ubuntu 20.04.4 LTS and use lightdm.
login through lighdm
type last
I will see
user tty7 :0 Fri Mar 18 14:14 gone - no logout
Something else
I am still not sure if this needs to be addressed in lightdm or last. In the last program, when it comes to decide if this is a phantom or not, it will check pw->pw_uid (from getpwnam) and /proc/pid/loginuid and if they are not the same, last will say this is a phantom process [1].
I found the pid of lightdm from using ps -ef | grep lightdm or extract pid in /var/log/wtmp, and manually compare it with a test program where I used getpwnam. The value of getpwnam is correct, but the value of /proc/pid/loginuids is a very big number. I guess this is because the owner of lightdm process is root on my machine, and whilst I used gdm3, it is the normal user.
I tested this on focal 20.4.4 LTS. I used lightdm version 1.30.0-0ubuntu4~20.04.2.
How to reproduce.
last
I will see
Something else
I am still not sure if this needs to be addressed in lightdm or last. In the
last
program, when it comes to decide if this is a phantom or not, it will check pw->pw_uid (from getpwnam) and /proc/pid/loginuid and if they are not the same,last
will say this is a phantom process [1].I found the pid of lightdm from using
ps -ef | grep lightdm
or extract pid in /var/log/wtmp, and manually compare it with a test program where I used getpwnam. The value of getpwnam is correct, but the value of /proc/pid/loginuids is a very big number. I guess this is because the owner of lightdm process is root on my machine, and whilst I used gdm3, it is the normal user.[1] https://github.com/util-linux/util-linux/blob/master/login-utils/last.c#L635