1819682 Members
3764 Online
109605 Solutions
New Discussion юеВ

Runlevel Definitions

 
Colleen_4
New Member

Runlevel Definitions

Hi all,

I'm trying to figure out what the various runlevels on HP-UX 11.X mean. Here's what I have so far:

0 - halt
1 - Single user
2 - Multi user w/ network
3 - Multi user w/ network and GUI
4 - reboot

Am I right?

Thanks in advance for your help...
12 REPLIES 12
Pete Randall
Outstanding Contributor

Re: Runlevel Definitions

I'm not sure what you mean by "4 - reboot", but other than that, you're correct. As used nowdays, only the first 3 runlevels have meaning. Runlevels above 3 are user-defined.


Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: Runlevel Definitions

Hi:

See the man pages for 'init(1M)' for the values.

Regards!

...JRF...
John Dvorchak
Honored Contributor

Re: Runlevel Definitions

Interesting since man 1m init says that run level 4 is where the GUI starts up but on all of mine there isn't anyting in /sbin/rc4.d the GUI and my/company'e stuff is in rc3.d. I kind of remember int he old days, when I still had short term memory, that run level 4 was where the GUI started.

In any event the list you have is correct except for 4 being reboot. Maybe someone at your location got creative and installed a reboot script there.

Good luck
If it has wheels or a skirt, you can't afford it.
Robert Gamble
Respected Contributor

Re: Runlevel Definitions

Yep, anything above run level 3 is user defined since 10.20.

At some of my customer locations, in rc4.d we put in scripts enabling the predictive modem to allow dial-in for support issues. A very nice tool to quickly enable/disable non-critical services.

Caution: do not run down a level from level 3. It is unsupported and may cause unpredictable results. Use the shutdown command to reboot and then go to single-user mode if necessary.

Good Luck!
Colleen_4
New Member

Re: Runlevel Definitions

So the consensus is that the man page is outdated?

Just to clarify, the only runlevels with networking are 2 and 3?
Pete Randall
Outstanding Contributor

Re: Runlevel Definitions

Colleen,

Yes, that's correct on both counts. The man page is outdated and the only runlevels with networking are 2 and 3.


Pete

Pete
T. M. Louah
Esteemed Contributor

Re: Runlevel Definitions

networking start at rl 2 , & any thing on top of it will be at run level 3, for example NFS has 3 basic componenets nfs.core starts in rl 2 & nfs.server/client starts at rl 3, so in order to get nfs to run we need networking to start first!
T??
Little learning is dangerous!
Patrick Wallek
Honored Contributor

Re: Runlevel Definitions

Networking is started at run-level 2 and is available at all higher run-levels.

Run level 1 (aka single-user mode) has no mounted filesystems, no applications started, very few OS services started and no networking. Run level 1 is accessable from the console (serial console, LAN console, web console) only.
John Dvorchak
Honored Contributor

Re: Runlevel Definitions

I agree the man pages are a bit dated. Remember that init runs up and down the list. From boot up it goes level 1 then 2 then 3 and if anything in 4 then it will got to 4 and above. On shutdown it goes from it's current run lever down back to 2 then to 1 and finally to 0. One tip that you should be aware of is that it is NOT suggested to go into Single user mode from a run level above. The only suggested way to enter Single user mode is from boot up, interact with the ISL and issue the HPUX -is command. I beleive the reason is that going from runlevel above 1 to level one doesn't really kill all of the sytem processes and results will be unpredictable.

Good luck
If it has wheels or a skirt, you can't afford it.
Michael Steele_2
Honored Contributor

Re: Runlevel Definitions

You're missing S - single user mode, see the init command.

s/S - single user
0 - halt, etc.

Those man pages are obsolete since 10.20 and 10.30.

Server network services startup at run level 2.

Client network services startup at run level 3. (* NFS for example. *)

These commands were significant when executing commands like: init 1, or init s/S in order to come down from multi user mode into a lesser run level, init s for example.

Consequently, attempting an 'init s' will no longer stop network processes.

I believe Solaris and Linux still support these init commands with run levels.
Support Fatherhood - Stop Family Law
RolandH
Honored Contributor

Re: Runlevel Definitions

Hey John D. you are NOT right with "and if anything in 4 then it will got to 4 and above"

Take a look in /etc/inittab first line.
What is there per default ?!
init:3:initdefault:

This means if the system has reached runlevel 3 it will stop to go further runlevels besides you have changed the runlevel explicit with init command or antoher default runlevel

Roland
Sometimes you lose and sometimes the others win
Stuart Abramson_2
Honored Contributor

Re: Runlevel Definitions

We put all of our user applications, like oracle, etc, in run level 4. We consider this a best practice. It seperates the user applications from the system applications, a few of which still start in run level 3 (nfs!, dtlogin).

So, we:
1. We change the first line of inittab from a "3" to a "4", so the system actually comes up to run-level 4 at boot.
2. We put our start scripts in /sbin/rc4.d/:
cd /sbin/rc4.d/
ln -s /sbin/init.d/oracle S100oracle

I would rewrite your list as (on our systems):

0 - halt
1 - Single user
2 - Multi user w/ network
3 - Multi user w/ network and GUI
4 - user applications

and you forgot run level "S" and logical volume maintenance mode.