02-16-2008
First s == S; init accepts either upper or lower case s. The meaning of s is built into the init program itself. If init comes up in level s, /etc/inittab is ignored. If init had been in a numeric run level, init will transition down to a point where /etc/inittab is ignored. This is the original and official single user mode. It is the only mode that works if /etc/inittab is missing. While init is in level S, init will ignore requests to reread /etc/inittab. In level S, init would originally connect a shell to the system console so that commands can be entered. Some versions of init, including Sun's, have a change to connect the login program to the console. This change makes the system more secure, but now booting up to single user requires /etc/passwd and /etc/shadow. Some versions of init can do either behavior depending on the security level of the OS. But all of this is built in to init and cannot be changed by modifying /etc/inittab.
The numeric run levels are under the control of the author of /etc/inittab. Sun uses:
0 = firmware mode...OS will die and you get the "ok" prompt
1 = "administrative" mode, Sun's replacement for single user mode with a very few things running
2 = multi-user mode, a lot of stuff running and people can sign on
3 = makes local resources available to other systems
4 = not used
5 = power down the system
6 = reboot the system
So "init 0" is very different... no OS at all will be running. Level s and Level S are different names for the same thing. Level S and 1 are very close in concept. The difference is that a few things will be running in level 1 and level 1 requires a good /etc/inittab.
Also Sun and everyone else cheat a little bit. If you are in a high level and enter level S, you do not really go all the way down to a "true" level S. They will leave a few things running. This leads the system admin's rule that a "true" level S is achieved only by rebooting and coming up directly to level S. This is partially because of intent and partially because some stuff just will not die.
10 More Discussions You Might Find Interesting
1. Filesystems, Disks and Memory
When the solaris 8 have come up, which command can find out the current run-level?
thanks. (2 Replies)
Discussion started by: nianzhe
2 Replies
2. SuSE
Hello,
I recently updated a test system from Suse 8 to 9.3. Now our runlevel services program doesn't work, but works fine on our other 9.3 boxes.
We have a file in /etc/init.d/rc3.d called S99fooprog(not actual name ofcourse).
It just has a command to start a program daemon up. Anyways... (3 Replies)
Discussion started by: benefactr
3 Replies
3. Solaris
Hi Experts,
A stupid question for experts :confused: !!
What is the difference between run level ‘1', runlevel ‘S' and small ‘s'.
As per my understanding the difference between S and 1 is that in case of ‘S' it only going to mount the critical file system which ideal should be... (2 Replies)
Discussion started by: kumarmani
2 Replies
4. UNIX for Advanced & Expert Users
Hi,
Could somebody throw some light on the below queries:
- For a run-level X, the S* scripts are executed when coming here from X-n run-level. The K* scripts are executed when coming to X runlevel from X+n runlevel.
- Does reaching to runlevel X from X-3 executes K* scritps from X-2 & X-1... (4 Replies)
Discussion started by: vibhor_agarwali
4 Replies
5. Solaris
Hi All,
In Solaris 9 and below
I will get the init run-level by checking the /etc/inittab entry
is:3:initdefault:
But in Solaris 10 we are using the smf functionality.
Here how I can get the init default run level.
Please help me in this problem.
Regards,
... (2 Replies)
Discussion started by: kalpeer
2 Replies
6. Solaris
what are the major Difference Between run level & init level (2 Replies)
Discussion started by: rajaramrnb
2 Replies
7. UNIX for Dummies Questions & Answers
A Bourne Shell script is placed in /etc/rc.d/rc3.d called S57apache. What will happen with this script when the run level is changed from 5 to 3?
many thanks (4 Replies)
Discussion started by: lemon_06
4 Replies
8. Solaris
Hello,
I'm creating a VM Image of Solaris 10 on VM Player. I've completed the installation & I am using the Java Desktop as my default logon. I need to modify the Run Level to Console Mode (permanently). Unlike previous versions or Linux, modifying inittab file is not an option here.
Please... (2 Replies)
Discussion started by: DevendraG
2 Replies
9. Shell Programming and Scripting
Is there a way to tell what runlevel is currently being used,
for example is a user is using the gui
or is the have pressed Alt+Ctrl+F1 to drop to the terminal?? (3 Replies)
Discussion started by: ab52
3 Replies
10. Solaris
for solaris 11, how does one change the run level at boot from 3 to 2?
i checked "/etc/inittab" file where i usually change it in other *nix but it seems solaris is not using it. (1 Reply)
Discussion started by: badbanana
1 Replies
inittab(4) Kernel Interfaces Manual inittab(4)
NAME
inittab - Controls the initialization process
SYNOPSIS
/etc/inittab
DESCRIPTION
The inittab file provides the init program with instructions for creating and running initialization processes. The init program reads the
inittab file each time init is invoked. The file typically contains instructions for the default initialization, the creation and control
of processes at each run level, and the getty command, which controls the activation of terminal lines.
Each line in the inittab file contains an entry that has four fields; each field is separated by a colon. There is no limit to the number
of entries in the inittab file. The entry syntax is as follows: Identifier:Runlevel:Action:Command
Specifies a fourteen character field used to uniquely identify an object. Specifies a twenty character field that defines the run levels
in which the object is to be processed. Runlevel corresponds to a configuration of processes in a system. Each process spawned by the init
command is assigned one or more run levels in which it is allowed to exist. The run levels are as follows: Specifies the halt state.
Specifies multiuser state without network services. Specifies multiuser state with network services. Specifies single-user state. You
can define multiple run levels for a process by specifying more than one run level character in any combination. Specifies a twenty char-
acter field that tells init how to treat the specified process. init recognizes the following Action values: Specifies that if the process
does not exist or if it dies, init starts it. If the process exists, init continues to process the inittab file. Specifies that if init
enters a run level that matches the run level specified in the inittab file entry, it starts the process and waits for its termination. As
long as init continues in this run level, it does not act on subsequent reads of the entry in the inittab file. Specifies that if init
enters a run level that matches the run level specified in the inittab file, it starts the process and does not wait for its termination.
When the process stops, init does not restart it. If init enters a new run level where the process is still running from a previous run-
level change, init does not restart the process. Specifies that when init first executes and reads the inittab file, it processes this
entry. The init program starts the process and does not wait for its termination. When the process stops, init does not restart it. The
run level specified in this inittab file entry should be the default run level, or it must match the run level in which init operates at
boot time. Specifies that when init first executes and reads the inittab file, it processes this inittab file entry. The init program
starts the process, waits for its termination and, when it dies, does not restart the process. (This value exists only for SVID3/SVR4 com-
patibility.) Specifies that if init receives the SIGPWR power fail signal, it executes the process associated with this line. (This value
exists only for SVID3/SVR4 compatibility.) Specifies that if init receives the SIGPWR power fail signal, it executes the process associ-
ated with this line and waits until the process terminates before continuing processing the inittab file. Specifies that if the process
associated with this line is currently running, init sends the warning signal SIGTERM and waits 20 seconds before sending the kill signal
SIGKILL. If the process does not existent, init ignores the inittab entry. Specifies that a line with this action is processed when init
is originally invoked. The init program uses this line to determine the run level to enter originally. It determines this by taking the
highest run level specified in the run level field and using that as its initial state. If the run level field is empty, this is inter-
preted as 0s23, causing init to enter run level 3. If init does not find an initdefault entry in the inittab file, it requests an initial
run level from the operator. Specifies that entries of this type are executed before init tries to access the console. This inittab file
entry should be used only to initialize devices on which init could attempt to request a run level. Specifies a 1024 character field that
contains the sh command to be executed. The command is prefixed with exec. Any legitimate sh syntax can appear in the command field. Com-
ments can be inserted be specifying a number sign (#). The line continuation character can be placed at the end of a line.
EXAMPLES
The following is an example of an inittab file entry for a terminal line: tty01:23:respawn:/usr/sbin/getty /dev/tty08 9600 vt100
FILES
Specifies the command that initializes and controls terminal lines.
RELATED INFORMATION
Commands: init(8), getty(8)
Functions: kill(2) delim off
inittab(4)