Query init runlevel?
am 09.04.2008 18:09:13 von Steven WoodyI forgot what command which can tell me current init runlevel value.
Thanks.
I forgot what command which can tell me current init runlevel value.
Thanks.
Steven Woody wrote:
> I forgot what command which can tell me current init runlevel value.
> Thanks.
who -r
--
Michael Tosch @ hp : com
On 2008-04-09, Steven Woody
>
>
> I forgot what command which can tell me current init runlevel value.
> Thanks.
runlevel ?
On 2008-04-09, Steven Woody wrote:
> On Apr 10, 12:30 am, Bill Marcum
>> On 2008-04-09, Steven Woody
>>
>>
>>
>> > I forgot what command which can tell me current init runlevel value.
>> > Thanks.
>>
>> runlevel ?
>
> Good! Thank you!
>
> The runlevel prints:
> N 3
> From the runlevel's man page, I got N means the previous runlevel is
> not exist. I can not understand this. I guess, there is at least one
> runlevel prior to level 3, such as 0. Why `runlevel' just tell me `N'?
If you haven't changed the runlevel since booting, there is no
previous runlevel and it will print N.
--
Chris F.A. Johnson, author
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
Steven Woody wrote:
> I forgot what command which can tell me current init runlevel value.
> Thanks.
Did you try "runlevel"?
Under linux it's usually available.
--
All the commands are tested with bash and GNU tools, so they may use
nonstandard features. I try to mention when something is nonstandard (if
I'm aware of that), but I may miss something. Corrections are welcome.
On Apr 10, 12:30 am, Bill Marcum
> On 2008-04-09, Steven Woody
>
>
>
> > I forgot what command which can tell me current init runlevel value.
> > Thanks.
>
> runlevel ?
Good! Thank you!
The runlevel prints:
N 3
From the runlevel's man page, I got N means the previous runlevel is
not exist. I can not understand this. I guess, there is at least one
runlevel prior to level 3, such as 0. Why `runlevel' just tell me `N'?
On Apr 9, 9:52=A0am, pk
Kaz Kylheku wrote:
> On Apr 9, 9:52 am, pk
"Chris F.A. Johnson"
> > The runlevel prints:
> > N 3
> > From the runlevel's man page, I got N means the previous runlevel is
> > not exist. I can not understand this. I guess, there is at least one
> > runlevel prior to level 3, such as 0. Why `runlevel' just tell me `N'?
>
> If you haven't changed the runlevel since booting, there is no
> previous runlevel and it will print N.
As I recall, some systems go from runlevel S to 2 to 3 at boot. I
suppose looking at /etc/inittab might help.
Maxwell Lol
>"Chris F.A. Johnson"
>
>> > The runlevel prints:
>> > N 3
>> > From the runlevel's man page, I got N means the previous runlevel is
>> > not exist. I can not understand this. I guess, there is at least one
>> > runlevel prior to level 3, such as 0. Why `runlevel' just tell me `N'?
>>
>> If you haven't changed the runlevel since booting, there is no
>> previous runlevel and it will print N.
>
>As I recall, some systems go from runlevel S to 2 to 3 at boot. I
>suppose looking at /etc/inittab might help.
>
That's not really what happens. The inittab file may cause the
scripts defined for the S level to be invoked, followed by the
ones for the 2 level, followed by the ones for the 3 level.
(Solaris 9 and earlier does this, for example)
However, that is an effect of the way the entries in the inittab
file are written. It is not a result of init moving through those
levels in that sequence.
-Greg
--
::::::::::::: Greg Andrews ::::: gerg@panix.com :::::::::::::
I have a map of the United States that's actual size.
-- Steven Wright
On 2008-04-10, Wayne
> Kaz Kylheku wrote:
>> On Apr 9, 9:52 am, pk
>>> Steven Woody wrote:
>>>> I forgot what command which can tell me current init runlevel value.
>>>> Thanks.
>>> Did you try "runlevel"?
>>> Under linux it's usually available.
>>
>> This is a part of sysvinit. Any distribution that uses sysvinit (and
>> hasn't messed up the packaging) should have this program in /sbin.
>
> True, but all Unix systems have the who command, so "who -r" is
> the more portable solution. (For example Solaris 10 doesn't
> use SysV init.)
>
Yes, it does, it's just moved most of the functionality into svcs.
Your rc directories and /etc/init.d are still there and operational.
They're mostly empty, but they're still there. I will admit, it
doesn't seem to have an /sbin/runlevel, but then, neither does
Solaris 9 (which uses only SysV init). runlevel appears to be a
linuxism. who -r is probably more portable, as you say.
--
Christopher Mattern
NOTICE
Thank you for noticing this new notice
Your noticing it has been noted
And will be reported to the authorities