Re: w idle time issue

Craig Small <[email protected]> Tue, 17 Dec 2024 11:04:56 +1100
Newsgroups gmane.linux.procps.devel
Message-ID <CALy8Cw4CZLeHn7LMn6ZLstJHx6wcmJeiab0ZjneERAcWm9igbw@mail.gmail.com>
--000000000000bc3e8906296c0c17
Content-Type: text/plain; charset="UTF-8"

On Fri, 6 Dec 2024 at 21:10, Dr. Werner Fink <[email protected]> wrote:

>
> Here the idle time of the session manager is seen, e.g.
> gnome-session-binary
>
Processes don't really have an idle time, they just have time where the
clock has moved forward but they didn't consume the CPU.
I suspect that gnome-session-binary still does things when a user is idle.


> Some more ... with the switch to systemd logind the open terminals are
> also not visible anymore ... only a simply `ls -l /dev/pts/[0-9]*` will
> show those (including those caused by an ssh login) ... with the help
> of lsof also user(s) can be seen
>
Yep, that threw me once. The pts files come and go depending on
if you have ssh or terminal sessions. For ssh, they are actually used for
the
idle time, because they do change their atime. For gnome/x terminals they
do change, but its a bad proxy for the X/Wayland session because:
* if the user has no terminal sessions, then there is no corresponding pty
* even if they do, they would be "idle" when using a, say, calculator, but
not using a terminal
* There's no good way of linking a users X/Wayland session and a pts

For 4.0.5, we'll leave it as-is.

For 4.0.6 there's two "fixes":
1) Just remove the idle column
2) Somehow detect the idle value is garbage and print "?" or something like
that in that case.

 - Craig


> Werner
>
> --
>   "Having a smoking section in a restaurant is like having
>           a peeing section in a swimming pool." -- Edward Burr
>

--000000000000bc3e8906296c0c17
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Fri, 6 Dec 2024 at 21:10, Dr. Werner F=
ink &lt;<a href=3D"mailto:[email protected]">[email protected]</a>&gt; wrote:</di=
v><div class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gma=
il_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,2=
04,204);padding-left:1ex"><br>
Here the idle time of the session manager is seen, e.g. gnome-session-binar=
y<br></blockquote><div>Processes don&#39;t really have an idle time, they j=
ust have time where the clock has moved forward but they didn&#39;t consume=
 the CPU.</div><div>I suspect that gnome-session-binary still does things w=
hen a user is idle.</div><div>=C2=A0<br></div><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20=
4);padding-left:1ex">
Some more ... with the switch to systemd logind the open terminals are<br>
also not visible anymore ... only a simply `ls -l /dev/pts/[0-9]*` will<br>
show those (including those caused by an ssh login) ... with the help<br>
of lsof also user(s) can be seen<br></blockquote><div>Yep, that threw me on=
ce. The pts files come and go depending on</div><div>if you have ssh or ter=
minal sessions. For ssh, they are actually used for the</div><div>idle time=
, because they do change their atime. For gnome/x terminals they</div><div>=
do change, but its a bad proxy for the X/Wayland session because:</div><div=
>* if the user has no terminal sessions, then there is no corresponding pty=
</div><div>* even if they do, they would be &quot;idle&quot; when using a, =
say, calculator, but not using a terminal</div><div>* There&#39;s no good w=
ay of linking a users X/Wayland session and a pts <br></div><div><br></div>=
<div>For 4.0.5, we&#39;ll leave it as-is.</div><div><br></div><div>For 4.0.=
6 there&#39;s two &quot;fixes&quot;:</div><div>1) Just remove the idle colu=
mn</div><div>2) Somehow detect the idle value is garbage and print &quot;?&=
quot; or something like that in that case.</div><div><br></div><div>=C2=A0-=
 Craig</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"margi=
n:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex=
">
<br>
Werner<br>
<br>
-- <br>
=C2=A0 &quot;Having a smoking section in a restaurant is like having<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 a peeing section in a swimming pool.&quo=
t; -- Edward Burr<br>
</blockquote></div></div>

--000000000000bc3e8906296c0c17--