Bug 760834 - who command returns unknown user and wrong user count
Summary: who command returns unknown user and wrong user count
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: gdm
Version: 23
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Ray Strode [halfline]
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-07 04:18 UTC by Larkin Lowrey
Modified: 2020-03-11 14:48 UTC (History)
21 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-20 12:10:27 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Larkin Lowrey 2011-12-07 04:18:38 UTC
Description of problem:
The who command (with no args or -u) returns the following first item when no user is logged in via the console:

(unknown) tty1         2011-12-05 22:56 23:10        2309 (:0)

Users logged in via ssh follow. Additionally, the --count command returns 1 plus the number of logged in users. If a user is logged in via the console the first entry properly reflects that. In other words, the first entry returned by who is always tty1 (:0) regardless of whether a user is logged into the console or not.

The who command from FC15 did not produce that entry when no user was logged into the console.

The behavior of 'who' now differs from the behavior of 'w'.

Version-Release number of selected component (if applicable):
8.12

How reproducible:
Every time

Steps to Reproduce:
1. ssh in when no user is logged into the console
2. run 'who -u'
3. run 'who --count'
  
Actual results:
who -u
 22:14:00 up 23:18,  2 users,  load average: 0.16, 0.21, 0.16
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
(unknown) tty1         2011-12-05 22:56 23:10        2309 (:0)
xxxxxxx  pts/0        2011-12-06 11:28 (xxxx.xxxx.com)

who --count
(unknown) xxxxxxxx
# users=2

Expected results:
who -u
 22:14:00 up 23:18,  2 users,  load average: 0.16, 0.21, 0.16
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
xxxxxxx  pts/0        2011-12-06 11:28 (xxxx.xxxx.com)

who --count
xxxxxxxx
# users=1

Additional info:

Comment 1 Kamil Dudka 2011-12-12 14:23:54 UTC
The 'who' utility uses getutent(), which reads the content of /var/run/utmp.  The reason why the 'w' utility does not print the outstanding line is that it hides all entries that cannot by matched with an entry in /proc:

    best = getproc(u, tty + 5, &jcpu, &ut_pid_found);

    /* just skip if stale utmp entry (i.e. login proc doesn't exist).  If there
     * is a desire a cmdline flag could be added to optionally show it with a
     * prefix of (stale) in front of cmd or something like that.
     */
    if (!ut_pid_found)
        return;

As there is nothing wrong at first glance in coreutils, I am switching the component to initscripts, which owns /var/run/utmp.

Comment 2 Bill Nottingham 2011-12-12 21:40:19 UTC
Moving to systemd for now - the issue is something wrote a bad utmp entry. Nothing in initscripts actually modifies utmp.

Comment 3 Michal Schmidt 2011-12-13 15:02:32 UTC
(In reply to comment #0)
> (unknown) tty1         2011-12-05 22:56 23:10        2309 (:0)

Is the gdm login screen running there? Does this line go away if you boot into multi-user.target instead of graphical.target?

Comment 4 Larkin Lowrey 2011-12-13 23:20:27 UTC
Yes, the gdm login screen is running.

Yes, the '(unknown)' line does go away when I switch to multi-user.target.

I installed F16 on another machine and it too shows the '(unknown)' entry.

Both of these machines were upgraded from F15.

Comment 5 Michal Schmidt 2011-12-14 01:28:45 UTC
gdm itself writes the '(unknown)' utmp entry. Reassigning.

Comment 6 Fedora End Of Life 2013-01-16 17:21:44 UTC
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Fedora End Of Life 2013-02-13 21:55:52 UTC
Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 8 cornel panceac 2013-06-11 16:40:53 UTC
This is on F17 x32 .

# last | grep unknown
(unknown :0           :0               Tue Jun 11 19:10 - 19:11  (00:00)    
(unknown :0           :0               Tue Jun 11 22:10 - 19:10  (-2:-59)   
(unknown :0           :0               Tue Jun 11 19:01 - down   (00:00)    
(unknown :0           :0               Tue Jun 11 15:29 - 15:29  (00:00)    
...

Unfortunately i can not change the status of the bug report.
Also, today the computer could not be shutted down because "another user is logged in".

Sounds like a knonw f18 bug. Maybe same fix can be applied?

Comment 9 Jóhann B. Guðmundsson 2013-06-11 16:53:57 UTC
Reopening bug

Comment 10 Jóhann B. Guðmundsson 2013-06-11 17:02:01 UTC
Running last | grep unknown | wc -l  on F18
164

GDM should identify itself

Comment 11 Easior Lars 2013-07-01 23:08:26 UTC
Same to me in Fedora 19 logged-in through ssh.

$ cat /etc/fedora-release 
Fedora release 19 (Schrödinger’s Cat)
$ who
(unknown) :0           2013-06-28 22:29 (:0)
easior   pts/0        2013-07-02 06:13 (x.x.x.x)

how to fix it?

Comment 12 Fedora End Of Life 2013-12-21 14:58:58 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 13 Fedora End Of Life 2014-02-05 22:43:47 UTC
Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 14 Michael Gruys 2014-12-28 23:38:52 UTC
In Fedora 21 this issue stills occurs. Also the 'last' command return this unknown user.

Version (kernel) fedora uname -a: Linux d3.17.7-300.fc21.x86_64 #1 SMP Wed Dec 17 03:08:44 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Comment 15 Michael Gruys 2014-12-28 23:47:08 UTC
Additional info:
This user appears in the output of the 'last' command after a reboot.

Comment 16 Michael Gruys 2014-12-28 23:50:56 UTC
Sorry for spamming. Found this topic about my issue:
http://unix.stackexchange.com/questions/118576/unknown-entries-in-kali-linux-wtmp-log-file

I think its safe to ignore this user

Comment 17 Jan Kurik 2015-07-15 15:12:21 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23

Comment 18 Fedora End Of Life 2016-11-24 10:35:28 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 19 Fedora End Of Life 2016-12-20 12:10:27 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.