xref: /onnv-gate/usr/src/cmd/initpkg/init.d/README (revision 0:68f95e015346)
1*0Sstevel@tonic-gate#
2*0Sstevel@tonic-gate# CDDL HEADER START
3*0Sstevel@tonic-gate#
4*0Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate# with the License.
8*0Sstevel@tonic-gate#
9*0Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate# See the License for the specific language governing permissions
12*0Sstevel@tonic-gate# and limitations under the License.
13*0Sstevel@tonic-gate#
14*0Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate#
20*0Sstevel@tonic-gate# CDDL HEADER END
21*0Sstevel@tonic-gate#
22*0Sstevel@tonic-gate#ident	"%Z%%M%	%I%	%E% SMI"
23*0Sstevel@tonic-gateCopyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*0Sstevel@tonic-gateUse is subject to license terms.
25*0Sstevel@tonic-gate
26*0Sstevel@tonic-gateNOTE: This directory contains legacy initialization and termination
27*0Sstevel@tonic-gatescripts for managing services.  The preferred method of service
28*0Sstevel@tonic-gatemanagement is via the Service Management Facility; to read more about
29*0Sstevel@tonic-gateSMF, consult smf(5).
30*0Sstevel@tonic-gate
31*0Sstevel@tonic-gateFile names in rc?.d directories are of the form [SK]nn<init.d filename>
32*0Sstevel@tonic-gatewhere 'S' means start this job, 'K' means kill this job, and 'nn' is the
33*0Sstevel@tonic-gaterelative sequence number for killing or starting the job.  When
34*0Sstevel@tonic-gateexecuting each script in one of the /etc/rc[S0-6] directories, the
35*0Sstevel@tonic-gate/sbin/rc[S0-6] script passes a single argument.  It passes the argument
36*0Sstevel@tonic-gate'stop' for scripts prefixed with 'K' and the argument 'start' for
37*0Sstevel@tonic-gatescripts prefixed with 'S'.  There is no harm in applying the same
38*0Sstevel@tonic-gatesequence number to multiple scripts.  In this case the order of
39*0Sstevel@tonic-gateexecution is deterministic but unspecified.  It is recommended that
40*0Sstevel@tonic-gatescripts be hard-linked from the same file stored in /etc/init.d/.
41*0Sstevel@tonic-gate
42*0Sstevel@tonic-gateOn earlier Solaris releases, a script named with a suffix of '.sh' would
43*0Sstevel@tonic-gatebe sourced, allowing scripts to modify the environment of other scripts
44*0Sstevel@tonic-gateexecuted later.  This behavior is no longer supported; for altering the
45*0Sstevel@tonic-gateenvironment in which services are run, refer to the SMF documentation.
46*0Sstevel@tonic-gate
47*0Sstevel@tonic-gateLegacy services are reported by the default svcs(1m) output, and (where
48*0Sstevel@tonic-gateappropriate) the utility's '-p' option.  This reporting assumes a
49*0Sstevel@tonic-gatebehavior as described above, such that each 'S' script has a suitable
50*0Sstevel@tonic-gatematching 'K' script, and they are both hard linked to a script in
51*0Sstevel@tonic-gate/etc/init.d/.  If this is not the case, legacy service reporting may not
52*0Sstevel@tonic-gateoperate accurately; under all circumstances, the scripts are always
53*0Sstevel@tonic-gateexecuted as described above.
54*0Sstevel@tonic-gate
55*0Sstevel@tonic-gateThe run-levels operate as follows:
56*0Sstevel@tonic-gate
57*0Sstevel@tonic-gates/S
58*0Sstevel@tonic-gate
59*0Sstevel@tonic-gate	Read /etc/rcS.d/README for details. This run-level corresponds to
60*0Sstevel@tonic-gate	the milestone svc:/milestone/single-user:default.
61*0Sstevel@tonic-gate
62*0Sstevel@tonic-gate0/5/6
63*0Sstevel@tonic-gate
64*0Sstevel@tonic-gate	All /etc/rc0.d/K* scripts are run, followed by all /etc/rc0.d/S*
65*0Sstevel@tonic-gate	scripts. The S* scripts should only be used for cleanup during
66*0Sstevel@tonic-gate	shutdown.
67*0Sstevel@tonic-gate
68*0Sstevel@tonic-gate1
69*0Sstevel@tonic-gate
70*0Sstevel@tonic-gate	If the system was in a higher run-level, all /etc/rc1.d/K* scripts
71*0Sstevel@tonic-gate	are run. Regardless of the previous run-level, all /etc/rc1.d/S*
72*0Sstevel@tonic-gate	scripts are run.
73*0Sstevel@tonic-gate
74*0Sstevel@tonic-gate2
75*0Sstevel@tonic-gate
76*0Sstevel@tonic-gate	Read /etc/rc2.d/README for details. This run-level corresponds to
77*0Sstevel@tonic-gate	the milestone svc:/milestone/multi-user:default.
78*0Sstevel@tonic-gate
79*0Sstevel@tonic-gate3
80*0Sstevel@tonic-gate
81*0Sstevel@tonic-gate	Read /etc/rc3.d/README for details. This run-level corresponds to
82*0Sstevel@tonic-gate	the milestone svc:/milestone/multi-user-server:default.
83*0Sstevel@tonic-gate
84