Bug 453249

Summary: who -r command do not report last runlevel
Product: [Fedora] Fedora Reporter: Gian Piero De Lolliis <red>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9CC: twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 6.10-27.fc9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-07-09 02:48:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gian Piero De Lolliis 2008-06-28 11:07:58 UTC
Description of problem:
the command who -r do no report last runlevel
eg.
who -r
         run-level 3  2008-06-28 12:01                   last=


Version-Release number of selected component (if applicable):
coreutils-6.10-25.fc9.i386


How reproducible:
in a terminal with 
who -r

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Ondrej Vasik 2008-06-30 07:38:38 UTC
Thanks for report, but it works for OK me on my machine. To better address the
problem, please answer following questions:
1)What does runlevel command print?
2)rpm -V coreutils
3)Is this upgrade from older Fedora's to F9 or clean installation?
TIA for answers.

Comment 2 Gian Piero De Lolliis 2008-06-30 13:56:38 UTC
Hi, 

actually the machine is in runlevel 3 with user root logged in.

1) [root@feedo ~]# who -r
         run-level 3  2008-06-30 18:40                   last=
2) rpm -V coreutils do not report nothing

3) this is a clean installation of F9 (no upgrade from previous version) with
all updates applied. 

Kind regards,
MT

Comment 3 Ondrej Vasik 2008-06-30 18:25:30 UTC
Thanks for quick response, but in #1 I asked for command `runlevel` (from
package SysVinit, usually located at /sbin/runlevel). That command has slightly
different implementation of getting runlevel than who -r (but both should report
the same results). Please provide the output from command `runlevel`. TIA again... 

Comment 4 Gian Piero De Lolliis 2008-07-01 06:06:52 UTC
Sorry for misunderstanting, the output of runlevel command is:

[root@feedo ~]# runlevel
N 3

Kind regards,
MT

Comment 5 Ondrej Vasik 2008-07-01 10:08:11 UTC
Thanks for information, 
that's quiet strange - as runlevel reports correct values (which should cause
output of `who -r` like "run-level 3  Jul  1 09:22                   last=S" -
and that's exactly output which I'm getting with F-9 coreutils who binary (with
same `runlevel` command output as you) . Will check the code of gnulib's
readutmp.c/h as this is responsible for computing who -r runlevel result. Just
for completeness, command `type who` returns correctly "who is hashed
(/usr/bin/who)"? 

Comment 6 Ondrej Vasik 2008-07-01 13:18:10 UTC
Actually there is issue with documentation as well (as I could not find some
options from --help in coreutils texinfo documentation). I still can't reproduce
the issue on my machine even with the runlevel 3, but I found one difference in
runlevel and who -r code, which could be relevant. Could you please check
coreutils rpm from http://koji.fedoraproject.org/koji/taskinfo?taskID=689642 ? TIA. 

Comment 7 Gian Piero De Lolliis 2008-07-01 14:38:03 UTC
(In reply to comment #5)
> command `type who` returns correctly "who is hashed
> (/usr/bin/who)"? 

The output is the same:
[root@feedo ~]# type who
who is /usr/bin/who

Kind regards,
MT


Comment 8 Gian Piero De Lolliis 2008-07-01 14:52:12 UTC
(In reply to comment #6)
> Actually there is issue with documentation as well (as I could not find some
> options from --help in coreutils texinfo documentation). I still can't reproduce
> the issue on my machine even with the runlevel 3, but I found one difference in
> runlevel and who -r code, which could be relevant. Could you please check
> coreutils rpm from http://koji.fedoraproject.org/koji/taskinfo?taskID=689642 ?
TIA. 

Hi, I've update coreutils package with the one you reported me
(coreutils-6.10-27.fc9.i386) and now i can read the last state from who -r command:

[root@feedo Desktop]# who -r
         run-level 3  2008-07-01 18:23                   last=S

Kind regards,
MT

Comment 9 Fedora Update System 2008-07-07 09:59:09 UTC
coreutils-6.10-27.fc9 has been submitted as an update for Fedora 9

Comment 10 Ondrej Vasik 2008-07-07 10:08:27 UTC
just FYI, solution style "print nothing for unprintable last runlevel result"
was chosen by upstream, so you will get output without "last=" after 6.10-27.fc9
will be pushed to stable. It's different handling than in the case of runlevel
command, but is more accurate (as handling status \0 (not known) as single user
could be misleading).

Comment 11 Fedora Update System 2008-07-09 02:48:17 UTC
coreutils-6.10-27.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.