Sun init States
Solaris init states refer to the level of services provided by the system.
The exact services and processes run at each init level are determined by
the scripts in the /etc/rc#.d directories. The default service levels for
each init state are listed below:
- 0: The system is at the PROM monitor (
ok>) or
security monitor (>) prompt. It is safe to shut down the
system when it is at this init state.
- 1, s or S: This state is known as "single-user" or "system
administrator" mode. Root is the only user on the system, and only
basic kernel functions are enabled. A limited number of filesystems
(usually only root and
/usr) are mounted. This init state
is often used for sensitive functions (such as kernel libc patches) or
while troubleshooting a problem that is keeping the system from booting
into multiuser mode.
- 2: Multiple users can log in. Most system services (except
for NFS server and printer resource sharing) are enabled.
- 3: Normal operating state. NFS and printer sharing is enabled,
where appropriate.
- 4: Usually undefined.
- 5: Associated with the
boot -a
command. The system is taken to init 0 and an interactive boot
is started.
- 6: Reboot. This state takes the system to init state 0 and then
to the default init state (usually 3, but can be redefined in the
/etc/inittab file).
The init states are defined in the /etc/inittab file, which
usually points at the scripts in /sbin/rcrun-level.
These scripts in turn examine the contents of the /etc/rcrun-level
directories. The scripts in these directories whose names begin with the
letter K are run in "stop" mode first in alphabetical order.
Then the scripts whose names begin with the letter S are run
in "start" mode in alphabetical order.
To get to a desired run level n, each of the rc (run control) scripts
from 1 to n is run. To get to run level 0, the K scripts
are run in each rc#.d directory between the current run
level and 0 in reverse numerical order.
In the default configuration, the rc scripts accomplish the following
tasks:
/sbin/rc0
- Stop system services/daemons.
- Terminate running processes.
- Unmount all file systems.
/sbin/rc1
- Stop system services/daemons.
- Terminate running processes.
- Unmount all file systems.
- Bring up the system in single-user mode.
/sbin/rc2
- Set the
TIMEZONE variable.
- Stop the print and NFS services.
- Stop the
vold daemon.
- Mount local filesystems, enable disk quotas (as appropriate).
- Remove temporary files.
- Create new device entries if this is the result of a
boot -r.
- Save a core file if enabled.
- Configure system accounting, (as appropriate).
- Set the default router.
- Set the NIS domain.
- Set up the network interfaces appropriately.
- Start
inetd.
- Start
named, if appopriate.
- Start
rpcbind.
- Start
kerbd (the Kerberos client daemon) if appropriate.
- Start
ypbind or rpc.nisd as appropriate.
- Start
keyserv.
- Start
statd and lockd.
- Mount NFS filesystems from
/etc/vfstab.
- Start the automounter.
- Start
cron.
- Start
lp daemons, as appropriate.
- Start
sendmail.
/sbin/rc3
- Clean up
sharetab.
- Start
nfsd and mountd.
- Start
rarpd and rpc.bootparamd, as appropriate.
/sbin/rc4 is usually not defined. It can be used in a
non-default configuration to achieve a tailored run level.
/sbin/rc5
- Kill print daemons.
- Unmount local file systems.
- Kill
syslogd.
- Unmount NFS file systems.
- Stop NFS services.
- Stop NIS services.
- Stop RPC services.
- Stop
cron services.
- Stop
statd and lockd (NFS client services).
- Kill active processes.
- Initiate an interactive boot.
/sbin/rc6
- Stop system services/daemons.
- Terminate running processes.
- Unmount all file systems.
- Boots to the
initdefault level from the
/etc/inittab
/sbin/rcS: This run level differs from 1 in the
following particulars:
- Minimal network is established.
- System name is set.
- root,
/usr and /usr/kvm filesystems are checked and
mounted (if necessary).
- Pseudo file systems
proc and /dev/ are started.
- Rebuilds device entries (for reconfiguration reboots only).