RC0(1M) INTERACTIVE UNIX System RC0(1M)
NAME
rc0 - run commands performed to stop the operating system
SYNOPSIS
/etc/rc0
DESCRIPTION
This file is executed at each system state change that needs
to have the system in an inactive state. It is responsible
for those actions that bring the system to a quiescent
state, traditionally called ``shutdown.''
One system state requires this procedure: state 0 (the sys-
tem halt state). Whenever a change to this state occurs,
the /etc/rc0 procedure is run. The entry in /etc/inittab
might read:
s0:0:wait:/etc/rc0 >/dev/console 2>&1 </dev/console
Some of the actions performed by /etc/rc0 are carried out by
files in the directory /etc/shutdown.d. and files beginning
with K in /etc/rc0.d. These files are executed in ASCII
order (see FILES below for more information), terminating
some system service. The combination of commands in
/etc/rc0 and files in /etc/shutdown.d and /etc/rc0.d deter-
mines how the system is shut down.
The recommended sequence for /etc/rc0 is:
Stop System Services and Daemons.
Various system services (such as Remote File Sharing or
LP Spooler) are gracefully terminated.
When new services are added that should be terminated
when the system is shut down, the appropriate files are
installed in /etc/shutdown.d and /etc/rc0.d.
Terminate Processes
SIGTERM signals are sent to all running processes by
killall(1M). Processes stop themselves cleanly if sent
SIGTERM.
Kill Processes
SIGKILL signals are sent to all remaining processes; no
process can resist SIGKILL.
At this point the only processes left are those associ-
ated with /etc/rc0 and processes 0 and 1, which are
special to the operating system.
Unmount All File Systems
Rev. Base System Page 1
RC0(1M) INTERACTIVE UNIX System RC0(1M)
Only the root file system (/) remains mounted.
FILES
The execution by /bin/sh of any files in /etc/shutdown.d
occurs in ASCII sort-sequence order. See rc2(1M) for more
information.
SEE ALSO
killall(1M), rc2(1M), shutdown(1M).
Rev. Base System Page 2