rc2.sh (0:68f95e015346) rc2.sh (1573:7338e65f2666)
1#!/sbin/sh
2#
3# CDDL HEADER START
4#
5# The contents of this file are subject to the terms of the
1#!/sbin/sh
2#
3# CDDL HEADER START
4#
5# The contents of this file are subject to the terms of the
6# Common Development and Distribution License, Version 1.0 only
7# (the "License"). You may not use this file except in compliance
8# with the License.
6# Common Development and Distribution License (the "License").
7# You may not use this file except in compliance with the License.
9#
10# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11# or http://www.opensolaris.org/os/licensing.
12# See the License for the specific language governing permissions
13# and limitations under the License.
14#
15# When distributing Covered Code, include this CDDL HEADER in each
16# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17# If applicable, add the following below this CDDL HEADER, with the
18# fields enclosed by brackets "[]" replaced with your own identifying
19# information: Portions Copyright [yyyy] [name of copyright owner]
20#
21# CDDL HEADER END
22#
23#
24# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
25# All rights reserved.
26#
27#
8#
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.
13#
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]
19#
20# CDDL HEADER END
21#
22#
23# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
24# All rights reserved.
25#
26#
28# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
27# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
29# Use is subject to license terms.
30#
31# ident "%Z%%M% %I% %E% SMI"
32
33# Run Commands executed when the system is changing to init state 2,
34# traditionally called "multi-user". Pick up start-up packages for mounts,
35# daemons, services, etc.
36
37PATH=/usr/sbin:/usr/bin
38
39if [ -z "$SMF_RESTARTER" ]; then
40 echo "Cannot be run outside smf(5)"
41 exit 1
42fi
43
28# Use is subject to license terms.
29#
30# ident "%Z%%M% %I% %E% SMI"
31
32# Run Commands executed when the system is changing to init state 2,
33# traditionally called "multi-user". Pick up start-up packages for mounts,
34# daemons, services, etc.
35
36PATH=/usr/sbin:/usr/bin
37
38if [ -z "$SMF_RESTARTER" ]; then
39 echo "Cannot be run outside smf(5)"
40 exit 1
41fi
42
43. /lib/svc/share/smf_include.sh
44
44action=$1
45
46# Export boot parameters to rc scripts
47
48set -- `/usr/bin/who -r`
49
50_INIT_RUN_LEVEL="$7" # Current run-level
51_INIT_RUN_NPREV="$8" # Number of times previously at current run-level

--- 8 unchanged lines hidden (view full) ---

60_INIT_UTS_MACHINE="$5" # Machine class (uname -m)
61_INIT_UTS_ISA="$6" # Instruction set architecture (uname -p)
62_INIT_UTS_PLATFORM="$7" # Platform string (uname -i)
63
64export _INIT_RUN_LEVEL _INIT_RUN_NPREV _INIT_PREV_LEVEL \
65 _INIT_UTS_SYSNAME _INIT_UTS_NODENAME _INIT_UTS_RELEASE _INIT_UTS_VERSION \
66 _INIT_UTS_MACHINE _INIT_UTS_ISA _INIT_UTS_PLATFORM
67
45action=$1
46
47# Export boot parameters to rc scripts
48
49set -- `/usr/bin/who -r`
50
51_INIT_RUN_LEVEL="$7" # Current run-level
52_INIT_RUN_NPREV="$8" # Number of times previously at current run-level

--- 8 unchanged lines hidden (view full) ---

61_INIT_UTS_MACHINE="$5" # Machine class (uname -m)
62_INIT_UTS_ISA="$6" # Instruction set architecture (uname -p)
63_INIT_UTS_PLATFORM="$7" # Platform string (uname -i)
64
65export _INIT_RUN_LEVEL _INIT_RUN_NPREV _INIT_PREV_LEVEL \
66 _INIT_UTS_SYSNAME _INIT_UTS_NODENAME _INIT_UTS_RELEASE _INIT_UTS_VERSION \
67 _INIT_UTS_MACHINE _INIT_UTS_ISA _INIT_UTS_PLATFORM
68
68_INIT_ZONENAME=`/sbin/zonename`
69#
70# Set _INIT_NET_STRATEGY and _INIT_NET_IF variables from /sbin/netstrategy
71#
72smf_netstrategy
69
73
70export _INIT_ZONENAME
71
72if [ "$_INIT_ZONENAME" = "global" ]; then
73 # Export net boot configuration strategy. _INIT_NET_IF is set to the
74 # interface name of the netbooted interface if this is a net boot.
75 # _INIT_NET_STRATEGY is set to the network configuration strategy.
76 set -- `/sbin/netstrategy`
77 if [ $? -eq 0 ]; then
78 if [ "$1" = "nfs" -o "$1" = "cachefs" ]; then
79 _INIT_NET_IF="$2"
80 fi
81 _INIT_NET_STRATEGY="$3"
82 export _INIT_NET_IF _INIT_NET_STRATEGY
83 fi
84fi
85
86case $action in
87 stop)
88 if [ -d /etc/rc2.d ]; then
89 for f in /etc/rc2.d/K*; do
90 if [ ! -s $f ]; then
91 continue
92 fi
93

--- 27 unchanged lines hidden ---
74case $action in
75 stop)
76 if [ -d /etc/rc2.d ]; then
77 for f in /etc/rc2.d/K*; do
78 if [ ! -s $f ]; then
79 continue
80 fi
81

--- 27 unchanged lines hidden ---