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