rc3.sh (0:68f95e015346) rc3.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 3,
34# same as state 2 (multi-user) but with remote file sharing.
35
36PATH=/usr/sbin:/usr/bin
37
38if [ -z "$SMF_RESTARTER" ]; then
39 echo "This script cannot be run outside smf(5)."
40 exit 1
41fi
42
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 3,
33# same as state 2 (multi-user) but with remote file sharing.
34
35PATH=/usr/sbin:/usr/bin
36
37if [ -z "$SMF_RESTARTER" ]; then
38 echo "This script cannot be run outside smf(5)."
39 exit 1
40fi
41
42. /lib/svc/share/smf_include.sh
43
43# Export boot parameters to rc scripts
44
45set -- `/usr/bin/who -r`
46
47_INIT_RUN_LEVEL="$7" # Current run-level
48_INIT_RUN_NPREV="$8" # Number of times previously at current run-level
49_INIT_PREV_LEVEL="$9" # Previous run-level
50

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

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

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

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

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

95 case $f in
96 *.sh) /lib/svc/bin/lsvcrun -s $f start ;;
97 *) /lib/svc/bin/lsvcrun $f start ;;
98 esac
99 fi
100 done
101fi
102
72if [ -d /etc/rc3.d ]; then
73 for f in /etc/rc3.d/K*; do
74 if [ -s $f ]; then
75 case $f in
76 *.sh) /lib/svc/bin/lsvcrun -s $f stop ;;
77 *) /lib/svc/bin/lsvcrun $f stop ;;
78 esac
79 fi

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

84 case $f in
85 *.sh) /lib/svc/bin/lsvcrun -s $f start ;;
86 *) /lib/svc/bin/lsvcrun $f start ;;
87 esac
88 fi
89 done
90fi
91
103if [ "$_INIT_ZONENAME" = "global" ]; then
92if smf_is_globalzone; then
104 # Unload all the loadable modules brought in during boot
105 # Delay a few seconds to allow dtlogin to open console first.
106
107 (sleep 5; modunload -i 0) & >/dev/null 2>&1
108fi
93 # Unload all the loadable modules brought in during boot
94 # Delay a few seconds to allow dtlogin to open console first.
95
96 (sleep 5; modunload -i 0) & >/dev/null 2>&1
97fi