Post AofSPMKfoJoZsvORFY by glent@aus.social
(DIR) More posts by glent@aus.social
(DIR) Post #AofI2DT7bIXsBzfdse by smallsees@social.dropbear.xyz
2024-12-03T09:52:47Z
0 likes, 0 repeats
Something odd has happened with #Linux sessions. I got a bug report that w no longer correctly reports user idle time.The idle time is determined by stat()ing the users tty device for last access time and taking that away from the current time. The idea is that every time the user interacts with the host, the tty access time updates.Except now it doesn't always happen and I'm not sure why or even how to fix it.
(DIR) Post #AofSPMKfoJoZsvORFY by glent@aus.social
2024-12-03T11:48:58Z
0 likes, 0 repeats
@smallsees Fedora 40. I see my login session not updating idle time$ w 21:55:24 up 1:05, 1 user, load average: 0.12, 0.24, 0.41USER TTY LOGIN@ IDLE JCPU PCPU WHATgdt tty2 20:50 1:05m 0.02s 0.02s /usr/libexec/gnome-session-binarywhich makes sense as the access time on /dev/tty2 doesn't change$ stat /dev/tty2 File: /dev/tty2 Size: 0 Blocks: 0 IO Block: 4096 character special fileDevice: 0,6Inode: 21 Links: 1 Device type: 4,2Access: (0620/crw--w----) Uid: ( 1002/ gdt) Gid: ( 5/ tty)Context: unconfined_u:object_r:user_tty_device_t:s0Access: 2024-12-03 20:49:55.781999987 +1030Modify: 2024-12-03 20:50:57.000000000 +1030Change: 2024-12-03 20:50:58.306682060 +1030 Birth: 2024-12-03 20:49:51.346999999 +1030That's a real character device and not a symlink$ ls -l /dev/tty2crw--w----. 1 gdt tty 4, 2 Dec 3 20:50 /dev/tty2The filesystem is$ fgrep '/dev ' /proc/mounts devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=4096k,nr_inodes=1986720,mode=755,inode64 0 0So yeah, there are a lot of moving parts.Also, there's the move of GNOME session initiation from /usr/libexec/gnome-session-binary to systemd. So maybe gnome-session-binary isn't seeing I/O on tty2 anymore, as that's being seen by some systemd user session.
(DIR) Post #AogHvvdjAZcoJkaqUC by smallsees@social.dropbear.xyz
2024-12-03T21:26:24Z
0 likes, 0 repeats
@glent Thanks Glen, that's what I'm seeing everywhere (that /dev/tty2 doesnt update the atime anymore).I even tried xfce on Xorg and that also had the issue, so it's not just Gnome. I'm not sure what changed to make this not work anymore.
(DIR) Post #AohPzdIqHUCxOe3sX2 by smallsees@social.dropbear.xyz
2024-12-04T10:31:24Z
0 likes, 0 repeats
It seems this #procps w idle issue goes wider. I've gone back to Debian 9 with kernel 4.19 and its still there.I think for a long time that w has not reported the idle time for a X/Wayland user correctly and what is worse there looks like there is no way to actually find out.#linux