Re: runlevel



Super User wrote:
mst wrote:

On Sat, 15 Apr 2006 13:45:16 +0200 Super User <duck7uck@xxxxxx> wrote:

using opensuse 10
my initdefault is 5,

why is this:
----------------------------
linux:~ # who -r
run-level 5 Apr 11 17:03 last=S
linux:~ # runlevel
N 5
--------------------------


So, what's your question? You're at runlevel 5.

the diff is the previous runlevel,
who -r reports S
runlevel reports N
why is this ?

What was the runlevel you ran before you went to init 5?
What would you expect to see? Have you tried running another runlevel to
see what the outcome would be? These would be things I would have done
if I were realy interested in it.

Now with some logical thinking, why do you think there is a difference
between the two outcomes.
1) who looks at who was logged in, it looks at users.
2) runlevel looks at what runlevel is run. It looks at the system.

Now deducting 2 seconds, the reason there is a difference is because the
first remembers things after a reboot and the second does not. So as
explained in the manpage it shows a N if it does not know what ran
before, because from a system point of view there was no previous
runlevel.
who looks at people logging in and logging out and does not understand
when or if a system reboots.

When you look at two differnt sorts of information, you can expect two
different types of outcome.

If you would have tried running a different runlevel, this would have
become apparant as well. Say you start with runlevel 5, then go to 3, it
will become
who -r :last=5 As expected
runlevel: 5 3 As expected
You then go back and see what you would have expected. At some point you
do a reboot and suddenly notice the difference. This would make you
understand that the reboot somehow wipes out the info.
Naturaly you already know what the N ment and would have come to the
same conclusion I just did. ;-)
--
houghi Please do not toppost http://houghi.org
Let's not be too tough on our own ignorance. It's the thing that makes
America great. If America weren't incomparably ignorant, how could we
have tolerated the last eight years? -- Frank Zappa, in 1988
.



Relevant Pages

  • Re: script to mail@localhost when system reboots
    ... On the systems I use (mandriva linux), I will, from time to time, kill ... most systems use a specific runlevel for reboot and a different ... i'd place the script in /etc/rc6.d ...
    (comp.unix.shell)
  • Re: CUPDS reboot the whole system
    ... > runlevel and going to reboot. ... This was on FreeBSD V5.3, ... Its also known that certain old Linux binaries that accidentally get run ... as FreeBSD binaries can call reboot() when trying a Linux SYSV syscall. ...
    (freebsd-stable)
  • Re: Hangs in parts.rc
    ... > The secon thin here is that it appears that the system is set to init 6 before ... I have understood that runlevels are modes of operation, and the reboot ... I think it is running in runlevel 5 when I break execution with ctrl-c, ... then I do a ctrl-alt-del and it switches to runlevel 6, ...
    (alt.os.linux)
  • Re: Hangs in parts.rc
    ... > The secon thin here is that it appears that the system is set to init 6 before ... I have understood that runlevels are modes of operation, and the reboot ... I think it is running in runlevel 5 when I break execution with ctrl-c, ... then I do a ctrl-alt-del and it switches to runlevel 6, ...
    (alt.linux)
  • Re: Did YOU last night, now nvidia is broken
    ... >> it works) in order for me to not logout to the CLI login. ... >> to runlevel 3 for login, unless I reboot. ...
    (alt.os.linux.suse)