bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: who -r


From: Bob Proulx
Subject: Re: who -r
Date: Sat, 15 Apr 2006 22:58:45 -0600
User-agent: Mutt/1.5.9i

ray h wrote:
> I was trying to find out what the result of "who -r" means, I underatand  
> it prints the current and previous runlevel, however "info who" yeilds no  
> explanation of what "S" means for the previous runlevel.
> 
>      run-level 5  Apr 15 20:33                   last=S

You did not say what system you are using.  The results are somewhat
system dependent.

The who command digs information from the system utmp file.  (In old
systems this used to be /etc/utmp and various information was logged
there.  In modern systems that is usually /var/run/utmp or other
"var"iable location.)  On my Debian system some documentation on utmp
may be found in the Linux Programmer's Manual (e.g. man utmp).

  man utmp

The 'who -r' command reports information logged to utmp about the run
level.  The run level logged to utmp indicates the state of the "init"
process.  The init process logs its runlevel to the utmp file whenever
it changes.  Information about init may be found in the init man page.

  man init

> The runlevel command does not print "S" for the last runlevel, it prints  
> N.  Why are these different and can we have the switch added to the  
> docuementation.

The "S" runlevel is the single user mode runlevel.  It is meant for
system activities.

The runlevel manual says:

  If there is no previous system runlevel, the letter N will be
  printed instead.

The who command prints "S" if the last runlevel is "N".  This is most
likely for compatibility with legacy Unix systems which print S for
the previous runlevel.  [But it may be the legacy systems tend to boot
to Single user mode first and from there continue to multiuser.]

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]