Operating System - HP-UX
1833325 Members
2802 Online
110051 Solutions
New Discussion

Run level S vs. run level s

 
SOLVED
Go to solution
Dmitry G. Spitsyn
Trusted Contributor

Run level S vs. run level s

Dear colleagues!
What is a difference between Run Levels S and s?
I've noticed that HP-UX's behavior is not as specified for RL S and s.
PLSE advise.
BR,
DGS
11 REPLIES 11
Patrick Wallek
Honored Contributor

Re: Run level S vs. run level s

There should be no difference between S and s. From the init man page:

S|s
Enter the single-user environment. When this level change occurs, the logical system console /dev/syscon is changed to the terminal from which the command was executed.


And even more from the man page:

0
Shut down HP-UX.

S|s
Use for system administration (also known as "single-user state"). When booting into run level S at powerup,the only access to the system is through a shell spawned at the system console as the root user. The only processes running on the system will be kernel daemons started directly by the HP-UX kernel, daemon processes started from entries of type sysinit in /etc/inittab, the shell on the system console, and any processes started by the system administrator.Administration operations that require the system to be
in a quiescent state (such as the fsck(1M) operation to repair a file system) should be run in this state. Transitioning into run level S from a higher run level does not terminate other system activity and does not result in a "single-user state"; this operation should
not be done.

1
Start a subset of essential system processes. This state can also be used to perform system administration tasks.

2
Start most system daemons and login processes. This state is often called the "multi-user state". Login processes either at local terminals or over the network are possible.

3
Export filesystems and start other system processes. In this state NFS filesystems are often exported, as may be required for an NFS server.

4
Activate graphical presentation managers and start other system processes.

5-6
These states are available for user-defined operations.


Bob Trombley
Occasional Advisor

Re: Run level S vs. run level s

Dmitry,

Run level s is a single-user run level and is used for system administration-related tasks. Only one physical system console can be used. The daemons available in this run level are those started by "init" having the "sysinit" keyword in the /etc/inittab file and any other daemon started directly by the HP-UX kernel. Run level S is just like s except that the terminal you are logged into acts as the system console.

Best,
Bob Trombley
BFA6
Respected Contributor

Re: Run level S vs. run level s

Hi,

Both S and s are single user states, but (if I've got this the right way round) run level S has the file systems mounted.

Hilary
Sebastian Galeski_1
Trusted Contributor

Re: Run level S vs. run level s


The predefined run-levels for HP-UX 10.x are as follows:

0 Halted or reboot level, All kill (K) and start (S) scripts in
/sbin/rc.0.d are executed.

S Single user state. All kill and start scripts on /sbin/rc.0.d
are executed.

1 Boot time system configuration. Necessary system configuration
is done at this state. (For example: assignment of the hostname,
mount of disk file systems, performing software configuration)
All kill and start scripts on /sbin/rc.1.d are executed.

2 Typically called multi-user state. Allows users to access the
system. All kill and start scripts on /sbin/rc.2.d are executed.

3 Networked multi-user state. NFS file systems can be exported.
All kill and start scripts on /sbin/rc.3.d are executed.

4 For HP-VUE users. All kill and start scripts on /sbin/rc.4.d
are executed.

5 Not defined.

6 Not defined.

there is no different between S and s
Wilfred Chau_1
Respected Contributor

Re: Run level S vs. run level s

As far as I know. If you enter init s, this is the same as shutdown without any argument.

But if you enter init S, it will also bring the system into single user, but it will not terminate you telnet session.

Try it on a test box!
Dmitry G. Spitsyn
Trusted Contributor

Re: Run level S vs. run level s

Thanks to all!
But does it mean that the only meaningful way of entering Run Level S|s is booting at powerup?
And what about changing to the logical system console?
BR,
DGS
Sanjay Verma
Super Advisor

Re: Run level S vs. run level s

Hi,

This is my 1st comment in ITRC. Pl. find my comments below:

Run Level "s"
-------------
Special run-level reserved for System administration.Referred to as single-user run-level meaning it???s reserved for a single user (typically system administrator).

Run Level "S"
-------------
This is Similar to run-level ???s???.In run-level ???s??? only the physical system console has access to the operating system, whereasIn run-level ???S??? (uppercase S) the capabilities of the system console are switched to the terminal where you are logged in, thus making it the virtual system console.

Should you require any further clarification on this, pl. feel free to email me.

Cheers,
Sanjay Verma

Co-operation - The biggest chain reaction
Paula J Frazer-Campbell
Honored Contributor

Re: Run level S vs. run level s

Welcome to the forum Sanjay.

Paula
If you can spell SysAdmin then you is one - anon
Dmitry G. Spitsyn
Trusted Contributor

Re: Run level S vs. run level s

Hello, Sanjay!

According to init man page: "Transitioning into run level S from a higher run level does not terminate other system activity and does not result in a "single-user state"; this operation should not be done." (See Patrick Wallek's note).

When entering RL S "from bottom up" ("from top down" approach doesn't make sense here) is it possible to have a system console to be switched from physical terminal to virtual?

BR,
DGS
Bill Hassell
Honored Contributor
Solution

Re: Run level S vs. run level s

From a practical sysadmin point of view, init s is not useful. The idea behind single user mode is to have a minimum set of services (like no networking, no mounted filesystems except / and /stand) but init s won't do this. Instead, init gets rid of processes that don't belong in single user mode but only if init owns them.

shutdown 0 used to be the method of choice as it would truly shutdown the system, bypass hardware selftests and reboot into true single user mode. Alas, changes have been made to where now (10.20 and higher), shutdown 0 no longer guarentees true single user mode.

So the only way to get into single used mode is to interrupt the boot process and use: hpux -is


Bill Hassell, sysadmin
Dmitry G. Spitsyn
Trusted Contributor

Re: Run level S vs. run level s

Thank you, Bill!

That's what I've suspected %{

BR,
DGS