'\" te .\" Copyright (c) 2001 Sun Microsystems, Inc. All Rights Reserved. .\" Copyright 1989 AT&T .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .TH INITTAB 4 "Dec 9, 2004" .SH NAME inittab \- script for init .SH DESCRIPTION .sp .LP The \fB/etc/inittab\fR file controls process dispatching by \fBinit\fR. The processes most typically dispatched by \fBinit\fR are daemons. .sp .LP It is no longer necessary to edit the \fB/etc/inittab\fR file directly. Administrators should use the Solaris Service Management Facility (SMF) to define services instead. Refer to \fBsmf\fR(5) and the \fISystem Administration Guide: Basic Administration\fR for more information on SMF. .sp .LP To modify parameters passed to \fBttymon\fR(1M), use \fBsvccfg\fR(1M) to modify the SMF repository. See \fBttymon\fR(1M) for details on the available SMF properties. .sp .LP The \fBinittab\fR file is composed of entries that are position dependent and have the following format: .sp .LP \fIid\fR\fB:\fR\fIrstate\fR\fB:\fR\fIaction\fR\fB:\fR\fIprocess\fR .sp .LP Each entry is delimited by a newline; however, a backslash (\e) preceding a newline indicates a continuation of the entry. Up to 512 characters for each entry are permitted. Comments may be inserted in the \fIprocess\fR field using the convention for comments described in \fBsh\fR(1). There are no limits (other than maximum entry size) imposed on the number of entries in the \fBinittab\fR file. The entry fields are: .sp .ne 2 .na \fB\fIid\fR\fR .ad .RS 11n One to four characters used to uniquely identify an entry. Do not use the characters "r" or "t" as the first or only character in this field. These characters are reserved for the use of \fBrlogin\fR(1) and \fBtelnet\fR(1). .RE .sp .ne 2 .na \fB\fIrstate\fR\fR .ad .RS 11n Define the run level in which this entry is to be processed. Run-levels effectively correspond to a configuration of processes in the system. That is, each process spawned by \fBinit\fR is assigned a run level(s) in which it is allowed to exist. The run levels are represented by a number ranging from \fB0\fR through \fB6\fR. For example, if the system is in run level \fB1\fR, only those entries having a \fB1\fR in the \fIrstate\fR field are processed. .sp When \fBinit\fR is requested to change run levels, all processes that do not have an entry in the \fIrstate\fR field for the target run level are sent the warning signal \fBSIGTERM\fR and allowed a 5-second grace period before being forcibly terminated by the kill signal \fBSIGKILL\fR. The \fIrstate\fR field can define multiple run levels for a process by selecting more than one run level in any combination from \fB0\fR through \fB6\fR. If no run level is specified, then the process is assumed to be valid at all run levels \fB0\fR through \fB6\fR. .sp There are three other values, \fBa\fR, \fBb\fR and \fBc\fR, which can appear in the \fIrstate\fR field, even though they are not true run levels. Entries which have these characters in the \fIrstate\fR field are processed only when an \fBinit\fR or \fBtelinit\fR process requests them to be run (regardless of the current run level of the system). See \fBinit\fR(1M). These differ from run levels in that \fBinit\fR can never enter run level \fBa\fR, \fBb\fR or \fBc\fR. Also, a request for the execution of any of these processes does not change the current run level. Furthermore, a process started by an \fBa\fR, \fBb\fR or \fBc\fR command is not killed when \fBinit\fR changes levels. They are killed only if their line in \fBinittab\fR is marked \fBoff\fR in the \fIaction\fR field, their line is deleted entirely from \fBinittab\fR, or \fBinit\fR goes into single-user state. .RE .sp .ne 2 .na \fB\fIaction\fR\fR .ad .RS 11n Key words in this field tell \fBinit\fR how to treat the process specified in the \fIprocess\fR field. The actions recognized by \fBinit\fR are as follows: .sp .ne 2 .na \fB\fBrespawn\fR\fR .ad .RS 13n If the process does not exist, then start the process; do not wait for its termination (continue scanning the \fBinittab\fR file), and when the process dies, restart the process. If the process currently exists, do nothing and continue scanning the \fBinittab\fR file. .RE .sp .ne 2 .na \fB\fBwait\fR\fR .ad .RS 13n When \fBinit\fR enters the run level that matches the entry's \fIrstate\fR, start the process and wait for its termination. All subsequent reads of the \fBinittab\fR file while \fBinit\fR is in the same run level cause \fBinit\fR to ignore this entry. .RE .sp .ne 2 .na \fB\fBonce\fR\fR .ad .RS 13n When \fBinit\fR enters a run level that matches the entry's \fIrstate\fR, start the process, do not wait for its termination. When it dies, do not restart the process. If \fBinit\fR enters a new run level and the process is still running from a previous run level change, the program is not restarted. .RE .sp .ne 2 .na \fB\fBboot\fR\fR .ad .RS 13n The entry is to be processed only at \fBinit\fR's boot-time read of the \fBinittab\fR file. \fBinit\fR is to start the process and not wait for its termination; when it dies, it does not restart the process. In order for this instruction to be meaningful, the \fIrstate\fR should be the default or it must match \fBinit\fR's run level at boot time. This action is useful for an initialization function following a hardware reboot of the system. .RE .sp .ne 2 .na \fB\fBbootwait\fR\fR .ad .RS 13n The entry is to be processed the first time \fBinit\fR goes from single-user to multi-user state after the system is booted. \fBinit\fR starts the process, waits for its termination and, when it dies, does not restart the process. .RE .sp .ne 2 .na \fB\fBpowerfail\fR\fR .ad .RS 13n Execute the process associated with this entry only when \fBinit\fR receives a power fail signal, \fBSIGPWR\fR (see \fBsignal\fR(3C)). .RE .sp .ne 2 .na \fB\fBpowerwait\fR\fR .ad .RS 13n Execute the process associated with this entry only when \fBinit\fR receives a power fail signal, \fBSIGPWR\fR, and wait until it terminates before continuing any processing of \fBinittab\fR. .RE .sp .ne 2 .na \fB\fBoff\fR\fR .ad .RS 13n If the process associated with this entry is currently running, send the warning signal \fBSIGTERM\fR and wait 5 seconds before forcibly terminating the process with the kill signal \fBSIGKILL\fR. If the process is nonexistent, ignore the entry. .RE .sp .ne 2 .na \fB\fBondemand\fR\fR .ad .RS 13n This instruction is really a synonym for the \fBrespawn\fR action. It is functionally identical to \fBrespawn\fR but is given a different keyword in order to divorce its association with run levels. This instruction is used only with the \fBa\fR, \fBb\fR or \fBc\fR values described in the \fIrstate\fR field. .RE .sp .ne 2 .na \fB\fBsysinit\fR\fR .ad .RS 13n Entries of this type are executed before \fBinit\fR tries to access the console (that is, before the \fBConsole Login:\fR prompt). It is expected that this entry will be used only to initialize devices that \fBinit\fR might try to ask the run level question. These entries are executed and \fBinit\fR waits for their completion before continuing. .RE .RE .sp .ne 2 .na \fB\fIprocess\fR\fR .ad .RS 11n Specify a command to be executed. The entire \fBprocess\fR field is prefixed with \fBexec\fR and passed to a forked \fBsh\fR as \fBsh \(mic 'exec\fR \fBcommand\fR'. For this reason, any legal \fBsh\fR syntax can appear in the \fIprocess\fR field. .RE .SH SEE ALSO .sp .LP \fBsh\fR(1), \fBwho\fR(1), \fBinit\fR(1M), \fBsvcadm\fR(1M), \fBsvc.startd\fR(1M), \fBttymon\fR(1M), \fBexec\fR(2), \fBopen\fR(2), \fBsignal\fR(3C), \fBsmf\fR(5) .sp .LP \fISystem Administration Guide: Basic Administration\fR .SH NOTES .sp .LP With the introduction of the service management facility, the system-provided \fB/etc/inittab\fR file is greatly reduced from previous releases. .sp .LP The \fBinitdefault\fR entry is not recognized in Solaris 10. See \fBsmf\fR(5) for information on \fBSMF\fR milestones, and \fBsvcadm\fR(1M), which describes the "\fBsvcadm\fR \fBmilestone\fR \fB-d\fR" command; this provides similar functionality to modifying the \fBinitdefault\fR entry in previous versions of the Solaris OS.