Operating System - HP-UX
1753774 Members
6899 Online
108799 Solutions
New Discussion юеВ

Re: how to view the current runlevel in hp-ux

 
SOLVED
Go to solution
senthil_kumar_2
Regular Advisor

how to view the current runlevel in hp-ux

Hi

In Redhat and suse linux. we can use following command to view the current run level.

Ex:

suse10tst: # runlevel
N 5


We can see the default runlevel in /etc/inittab.

but i want to know current runlevel of hpux.

is it possible.
20 REPLIES 20
Sajjad Sahir
Honored Contributor
Solution

Re: how to view the current runlevel in hp-ux


Dear Senthil

The command is who -r

thanks and regards

Sajjad Sahir
avizen9
Esteemed Contributor

Re: how to view the current runlevel in hp-ux

hello
you can check the current run level in all hpux flavour with
who -r

also check man who will get more detail help, thanks,
Jeeshan
Honored Contributor

Re: how to view the current runlevel in hp-ux

who -r or runlevel command
a warrior never quits
R.K. #
Honored Contributor

Re: how to view the current runlevel in hp-ux

Hello Senthil,

You can get the runlevel by "who -r" command as shown:

root> who -r
. run-level 3 May 22 17:22 3 0 2

Here the server is in runlevel 3

-r Indicates the current run-level of the init process. The last three fields contain the current state of init, the number of times that state has been previously entered, and the previous state. These fields are updated each time init changes to a different run state.

Regds,
R.K.
Don't fix what ain't broke
Johnson Punniyalingam
Honored Contributor

Re: how to view the current runlevel in hp-ux

Hi,

# who -r ==> will show you current runlevel of hpux.

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
James R. Ferguson
Acclaimed Contributor

Re: how to view the current runlevel in hp-ux

Hi:

Does anyone READ what has already been posted? Endlessly repeating the same answer adds NOTHING!

NO POINTS FOR THIS COMMENT.

...JRF...
johnsonpk
Honored Contributor

Re: how to view the current runlevel in hp-ux

I agree with James..

Repeating the same answer by different user (for sake of adding points to own account)will add NO VALUES to this forum rather makes it quite boring to read...

Thanks!!
Johnson
Dennis Handly
Acclaimed Contributor

Re: how to view the current runlevel in hp-ux

>I want to know current runlevel of HP-UX.

Why do you need it? Is is for some rc(1m) script?

>JRF: Does anyone READ what has already been posted?

It's not enough to read the man page and the current thread. You need to read other threads and you'll find out that "who -r" doesn't work at all.
The result of who(1) is nearly the same as "echo 3".

There was mention of getrunlvl but that may not work either:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1325385
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1239710
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1238202
Kranti Mahmud
Honored Contributor

Re: how to view the current runlevel in hp-ux

Hi Senthil,

who -r gives current run level
/etc/inittab

Hp-UX has the following Run levels:
s single user
2 multi-user; no NFS server capabilities
3 multi-user with NFS server
4 same as 3, but with HP VUE

To change runlevels:
/sbin/shutdown -y 0 # to go to single user state
/sbin/init # bring the system up in the new runlevel

Rgds-Kranti
Dont look BACK as U will miss something INFRONT!