Re: What is a 'run-level' in Solaris 10?



On May 2, 2:23 pm, Wayne <nos...@xxxxxxxxxxxxxx> wrote:
ubyt3m3 wrote:
On May 1, 10:27 pm, Rich Teer <rich.t...@xxxxxxxxxxxxxx> wrote:
On Thu, 1 May 2008, ubyt3m3 wrote:

    .       run-level 3  Nov 29 10:59     3      0  S
can anyone tell me what each field (output fromwho -r) represents?
Yes, but you'd get the answer quicker if you did your own research
(hint: man who).

--
Rich Teer, SCSA, SCNA, SCSECA

CEO,
My Online Home Inventory

URLs:http://www.rite-group.com/rich
     http://www.linkedin.com/in/richteer
     http://www.myonlinehomeinventory.com

uh... i already checked the man page and there is no explanation for
each field so i'm asking in this group.

who -rH produces below output:

# who -rH
NAME       LINE         TIME          IDLE    PID  COMMENTS
   .       run-level 3  Oct 23 18:22     3      0  S

But this doesn't make sense to me.  PID = 0 and COMMENTS = S?  I know -
H gives just general headings.
I'm curious what they represents.

Those headers don't apply when using -r.  You're right the output
isn't documented, but I'm pretty sure the first part is
the current run-level ("3") and the date the run-level was last changed.
The previous run-level ("S") must be4 that last value, but I don't know
what the "3" and "0" in the middle mean, it isn't documented anywhere.

I tried reading the source code for who athttp://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/who...
(and also utmp.h).  But a cursory read doesn't show what that output
means:

     675        /*
     676         *      Handle RUN_LVL process - If no alt. file - Only one!
     677         */
     678        if (utmpp->ut_type == RUN_LVL) {
     679                (void) printf("     %c  %5ld  %c", pterm, utmpp->ut_pid,
     680                    pexit);
     681                if (optcnt == 1 && !validtype[USER_PROCESS]) {
     682                        (void) printf("\n");
     683                        exit(0);
     684                }
     685        }

This appears to be where the final "3   0   S" are printed from,
but without any comments one would have to read and understand more than
this to interpret those values.

A little work with Google reveals this is a common question.  I only
found one answer to it, at:

http://unix.derkeiler.com/Newsgroups/comp.unix.solaris/2003-09/1484.html

  From: Senthilraja R (sruthrap_at_cisco.com)
  Date: 09/12/03

#who -r
. run level 3 Jun 9 08:30 3 0 S
3- Current run level
0- Number of times at this run level since last reboot
S- Previous run level

But there is no indication that this answer is authoritative.

This really should be considered a bug in the documentation and
could be easily fixed by someone knowledgeable about who.c.
Would one of the Sun people reading this take care of this long
standing omission please, and update the who(1) man page?

Thanks!

-Wayne- Hide quoted text -

- Show quoted text -

Thanks for the info, Wayne.
.



Relevant Pages

  • Re: why are some types immutable?
    ... Torsten Mohr schrieb: ... > reading the documentation (and also from a hint from this NG) ...
    (comp.lang.python)
  • why are some types immutable?
    ... reading the documentation (and also from a hint from this NG) ... for example for a large string it could be much faster to ...
    (comp.lang.python)
  • Re: Count Lines in (Huge) Text Files
    ... Of course, the OS is free to ignore the hint, but from your description it sounds like at least some of the time it doesn't and the file data winds up _not_ being cached. ... There's some overhead to caching, so providing that hint could be important when you really are reading a lot of files, all of them just once through. ... But it does add even more overhead to the scanning code, making it even more pointless to optimize the actual "look for line breaks" part. ... So not only are they memory-lightweight, if you find that scanning the file is an unacceptable cost, that would be the way to go. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Pass array of worksheets to ActiveX DLL (VB6)
    ... After reading what you had to say I Googled some of his posts ... faster for them to develop their own applications, ... reach for the documentation every couple of minutes to find out "so ... Hank Scorpio ...
    (microsoft.public.excel.programming)
  • Re: Patents Unleashed and the future of Java Programming
    ... Have you ever seen documented an algorithm for determining the number ... However, I disqualify "reading coworkers code", "looking at ... Even the most anal retentive documentation efforts (I've worked on ...
    (comp.lang.java.programmer)