You are not logged in.

#1 2023-05-28 23:57:24

D3vil0p3r
Member
Registered: 2022-11-05
Posts: 205

User logged in two sessions simultaneously with no reason

Hello, I'm using Arch Linux with GNOME 44 with GDM and I note that, also when I reboot, my system sees two sessions from my user account that I never used and I don't know if it is expected or it is a wrong behavior of the system itself.

When I run "users" command, I get

athena athena

and when I run "w" on Wayland, I get:

 01:50:02 up 4 min,  2 users,  load average: 0.71, 0.33, 0.14
USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
athena   seat0     01:49    0.00s  0.00s  0.00s /usr/lib/gdm-wayland-session /usr/bin/gnome-session
athena   tty2      01:49    4:12   0.03s  0.00s /usr/lib/gdm-wayland-session /usr/bin/gnome-session

But I never logged on tty2.

When I run "w" on Xorg, I get:

 01:54:17 up 1 min,  2 users,  load average: 6.57, 1.64, 0.55
USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
athena   seat0     01:54    0.00s  0.00s  0.00s /usr/lib/gdm-x-session --run-script /usr/bin/gnome-session
athena   :0        01:54   ?xdm?  22.23s  0.00s /usr/lib/gdm-x-session --run-script /usr/bin/gnome-session

Despite all this, when I run "loginctl", I get:

SESSION  UID USER   SEAT  TTY 
      3 1000 athena seat0 tty2

1 sessions listed.

Why on the first 2 commands I get my user two times? At this point what is the most efficient way or command to check how many users are logged in the system?

Offline

#2 2023-05-29 06:37:50

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,244

Re: User logged in two sessions simultaneously with no reason

This seems common, GDM adds two sessions to /var/run/utmp
xterm will (by default) also add an entry, so if you run "xterm" you'll get another "session" in users and w (on some pts)

Offline

#3 2023-05-29 11:10:18

loqs
Member
Registered: 2014-03-06
Posts: 18,961

Re: User logged in two sessions simultaneously with no reason

Long term utmp is not Y2038 safe so is being replace by systemd-logind e.g. [1][2] so the outputs at some future point should become consistent.

[1]  https://gitlab.com/procps-ng/procps/-/c … b0d7b9e9d0
[2]  https://github.com/util-linux/util-linu … 1836ab2edc

Offline

Board footer

Powered by FluxBB