[Bug 268780] Re: who (or w) does not report correctly idle time

Phillip Susi psusi at cfl.rr.com
Fri Dec 16 20:38:13 UTC 2011


Well, it seems that who computes the idle time by using the timestamps
of the tty device file, which are updated every time a process reads
input.  The problem is that X ( and also emacs ) don't read from the
tty, so the timestamps are not updated.

I think that fixing this is going to require overhauling the virtual
console code to move the VC ttys under the /dev/pts filesystem so that
/dev/tty can actually open the proper inode, and so that there can be a
master inode to update when events come in rather than when they are
read.  Oh boy.


** Package changed: coreutils (Ubuntu) => linux (Ubuntu)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to coreutils in Ubuntu.
https://bugs.launchpad.net/bugs/268780

Title:
  who (or w) does not report correctly idle time

Status in “linux” package in Ubuntu:
  Triaged

Bug description:
  Binary package hint: coreutils

  Release: [Ubuntu 8.04.1]
  ---------

  Package: coreutils (included in the core of Ubuntu)
  ----------
  cat /proc/version
  Linux version 2.6.24-19-generic (buildd at king) (gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)) #1 SMP Wed Aug 20 17:53:40 UTC 2008


  When you do :

  info coreutils 'who invocation'

  The documentation says :

  `-u'
       After the login time, print the number of hours and minutes that
       the user has been idle.  `.' means the user was active in the last
       minute.  `old' means the user has been idle for more than 24 hours.

  
  What I expect to happen
  -------------------------------
  When you type the command
  who -u
  who -a
  w

  I expect to happen what is written in the documentation: get the idle
  time.

  To my understanding, 'idle' means that the user does not use any input
  device : keyboard, mouse, touchpad, tablet...

  
  What I get instead:
  ----------------------- 
  The "bug" is that mouse events are not at all taken into account (I don't know for tablets, joystisk...)

  
  How to reproduce the "bug":
  ------------------------------------

  To check that, put the following script on you desktop :

  who.sh
  #######
  #!/bin/bash
  who -a
  read key

  Then DO NOT touch the keyboard, and launch the script with the mouse.
  Kill it also with the mouse.

  You'll see the idle timer going up for your user + tty7 (if you are
  using default Ubuntu settings for your graphical desktop), although
  you are not idle because you moved the mouse and clicked.

  Same if you replace who by w

  
  Conclusion:
  --------------
  So either the behavior is wrong, or the documentation is inacurate about what is considered being idle.

  
  Related suggestion:
  -------------------------
  It could also be added in the documentation, that idle time is ALSO reported as 'old' when the user has always been idle (in the meaning 'who' gives to it) since the beginning of the session. So in fact, the user might have been active just a few minutes before on another session, and it's not only when you have "more than 24 hours" of 'idle'. 

  
  May be related bugs:
  ---------------------------
  Second bug with the idle timer, when you open a remote X session (for instance, CTRL+ALT+F1 and X -query 192.168.0.XXX :1), the idle timer is ALWAYS reported as 'old' in this session, even if you do keyboard inputs.
  It is seen as 'old' by the remote user, or by an user connected locally to this remote station.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/268780/+subscriptions




More information about the foundations-bugs mailing list