5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance 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]
23 # Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
26 # ident "%Z%%M% %I% %E% SMI"
28 # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
29 # All rights reserved.
33 # This file executes the commands in the rcS.d directory, which are necessary
34 # to get the system to single user mode:
36 # establish minimal network plumbing (for diskless and dataless)
37 # mount /usr (if a separate file system)
39 # check the root (/) and /usr file systems
40 # check and mount /var and /var/log (if a separate file system)
41 # mount pseudo file systems (/dev/fd)
42 # if this is a reconfiguration boot, [re]build the device entries
43 # check and mount other file systems to be mounted in single user mode
45 if [ -z "$SMF_RESTARTER" ]; then
46 echo "Cannot be run outside smf(5)"
50 .
/lib
/svc
/share
/smf_include.sh
53 # Default definitions:
55 PATH
=/usr
/sbin
:/usr
/bin
:/sbin
64 # Export boot parameters to rc scripts
66 if [ "x$1" != xsysinit
-a -d /usr
/bin
]; then
67 set -- `/usr/bin/who -r`
69 _INIT_RUN_LEVEL
=${7:-S} # Current run-level
70 _INIT_RUN_NPREV
=${8:-0} # Number of times previously at current level
71 _INIT_PREV_LEVEL
=${9:-0} # Previous run-level
78 set -- `/usr/bin/uname -a`
81 # If we're booting, uname -a will produce one fewer token than usual because
82 # the hostname has not yet been configured. Leave NODENAME empty in this case.
85 _INIT_UTS_SYSNAME
="$1" # Operating system name (uname -s)
86 _INIT_UTS_NODENAME
="$2" # Node name (uname -n)
89 _INIT_UTS_SYSNAME
="$1" # Operating system name (uname -s)
90 _INIT_UTS_NODENAME
= # Node name is not yet configured
94 _INIT_UTS_RELEASE
="$1" # Operating system release (uname -r)
95 _INIT_UTS_VERSION
="$2" # Operating system version (uname -v)
96 _INIT_UTS_MACHINE
="$3" # Machine class (uname -m)
97 _INIT_UTS_ISA
="$4" # Instruction set architecture (uname -p)
98 _INIT_UTS_PLATFORM
="$5" # Platform string (uname -i)
100 export _INIT_RUN_LEVEL _INIT_RUN_NPREV _INIT_PREV_LEVEL \
101 _INIT_UTS_SYSNAME _INIT_UTS_NODENAME _INIT_UTS_RELEASE _INIT_UTS_VERSION \
102 _INIT_UTS_MACHINE _INIT_UTS_ISA _INIT_UTS_PLATFORM
105 # Set _INIT_NET_STRATEGY and _INIT_NET_IF variables from /sbin/netstrategy
109 .
/lib
/svc
/share
/fs_include.sh
112 # Make the old, deprecated environment variable (_DVFS_RECONFIG) and the new
113 # supported environment variable (_INIT_RECONFIG) to be synonyms. Set both
114 # if the svc.startd reconfigure property is set. Note that for complete
115 # backwards compatibility the value "YES" is significant with _DVFS_RECONFIG.
116 # The # value associated with _INIT_RECONFIG is insignificant. What is
117 # significant is only that the environment variable is defined.
120 svcprop
-q -p system
/reconfigure system
/svc
/restarter
:default
123 echo "Setting _INIT_RECONFIG."
124 _DVFS_RECONFIG
=YES
; export _DVFS_RECONFIG
125 _INIT_RECONFIG
=set; export _INIT_RECONFIG
133 # All remote filesystem services must be explicitly disabled
134 # at the single-user milestone. There's no need to unmount
135 # remote filesystems here.
137 if [ -d /etc
/rcS.d
]; then
138 for f
in /etc
/rcS.d
/K
*; do
144 *.sh
) /lib
/svc
/bin
/lsvcrun
-s $f stop
146 *) /lib
/svc
/bin
/lsvcrun
$f stop
;;
154 if [ -d /etc
/rcS.d
]; then
155 for f
in /etc
/rcS.d
/S
*; do
161 *.sh
) /lib
/svc
/bin
/lsvcrun
-s $f start
163 *) /lib
/svc
/bin
/lsvcrun
$f start
;;
169 # Clean up the /reconfigure file and sync the new entries to
173 # GLXXX - svc.startd should do this?
174 if [ -n "$_INIT_RECONFIG" ]; then
175 [ -f /reconfigure
] && /usr
/bin
/rm -f /reconfigure
181 echo "Usage: $0 { start | stop }"
182 exit $SMF_EXIT_ERR_CONFIG