rc0(ADM) 19 June 1992 rc0(ADM) Name rc0 - run commands performed to stop the operating system Syntax /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 system 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 in- formation), terminating some system service. The combination of commands in /etc/rc0 and files in /etc/shutdown.d and /etc/rc0.d determines how the system is shut down. The recommended sequence for /etc/rc0 is: 1. Stop system services and daemons. Various system services (such as the lp spooler) are gracefully ter- minated. 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. 2. Terminate processes. SIGTERM signals are sent to all running processes by killall(ADM). Processes stop themselves cleanly if sent SIGTERM. 3. Kill processes. SIGKILL signals are sent to all remaining processes; no process can resist SIGKILL. At this point the only processes left are those associated with /etc/rc0 and processes 0 and 1, which are special to the operating system. 4. Unmount all filesystems. Only the root filesystem (/) remains mounted. Notes This file is intended for execution by init. It should not be executed by the user under any circumstances. Files The execution by /bin/sh of any files in /etc/shutdown.d occurs in ASCII sort-sequence order. See rc2(ADM) for more information. See also killall(ADM), rc2(ADM), shutdown(ADM)