10Sstevel@tonic-gate#!/sbin/sh 20Sstevel@tonic-gate# 30Sstevel@tonic-gate# CDDL HEADER START 40Sstevel@tonic-gate# 50Sstevel@tonic-gate# The contents of this file are subject to the terms of the 6*1573Sdp# Common Development and Distribution License (the "License"). 7*1573Sdp# You may not use this file except in compliance with the License. 80Sstevel@tonic-gate# 90Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 100Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 110Sstevel@tonic-gate# See the License for the specific language governing permissions 120Sstevel@tonic-gate# and limitations under the License. 130Sstevel@tonic-gate# 140Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 150Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 160Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 170Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 180Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 190Sstevel@tonic-gate# 200Sstevel@tonic-gate# CDDL HEADER END 210Sstevel@tonic-gate# 220Sstevel@tonic-gate# 230Sstevel@tonic-gate# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T. 240Sstevel@tonic-gate# All rights reserved. 250Sstevel@tonic-gate# 260Sstevel@tonic-gate# 27*1573Sdp# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 280Sstevel@tonic-gate# Use is subject to license terms. 290Sstevel@tonic-gate# 300Sstevel@tonic-gate# ident "%Z%%M% %I% %E% SMI" 310Sstevel@tonic-gate 320Sstevel@tonic-gate# Run Commands executed when the system is changing to init state 3, 330Sstevel@tonic-gate# same as state 2 (multi-user) but with remote file sharing. 340Sstevel@tonic-gate 350Sstevel@tonic-gatePATH=/usr/sbin:/usr/bin 360Sstevel@tonic-gate 370Sstevel@tonic-gateif [ -z "$SMF_RESTARTER" ]; then 380Sstevel@tonic-gate echo "This script cannot be run outside smf(5)." 390Sstevel@tonic-gate exit 1 400Sstevel@tonic-gatefi 410Sstevel@tonic-gate 42*1573Sdp. /lib/svc/share/smf_include.sh 43*1573Sdp 440Sstevel@tonic-gate# Export boot parameters to rc scripts 450Sstevel@tonic-gate 460Sstevel@tonic-gateset -- `/usr/bin/who -r` 470Sstevel@tonic-gate 480Sstevel@tonic-gate_INIT_RUN_LEVEL="$7" # Current run-level 490Sstevel@tonic-gate_INIT_RUN_NPREV="$8" # Number of times previously at current run-level 500Sstevel@tonic-gate_INIT_PREV_LEVEL="$9" # Previous run-level 510Sstevel@tonic-gate 520Sstevel@tonic-gateset -- `/usr/bin/uname -a` 530Sstevel@tonic-gate 540Sstevel@tonic-gate_INIT_UTS_SYSNAME="$1" # Operating system name (uname -s) 550Sstevel@tonic-gate_INIT_UTS_NODENAME="$2" # Node name (uname -n) 560Sstevel@tonic-gate_INIT_UTS_RELEASE="$3" # Operating system release (uname -r) 570Sstevel@tonic-gate_INIT_UTS_VERSION="$4" # Operating system version (uname -v) 580Sstevel@tonic-gate_INIT_UTS_MACHINE="$5" # Machine class (uname -m) 590Sstevel@tonic-gate_INIT_UTS_ISA="$6" # Instruction set architecture (uname -p) 600Sstevel@tonic-gate_INIT_UTS_PLATFORM="$7" # Platform string (uname -i) 610Sstevel@tonic-gate 620Sstevel@tonic-gateexport _INIT_RUN_LEVEL _INIT_RUN_NPREV _INIT_PREV_LEVEL \ 630Sstevel@tonic-gate _INIT_UTS_SYSNAME _INIT_UTS_NODENAME _INIT_UTS_RELEASE _INIT_UTS_VERSION \ 640Sstevel@tonic-gate _INIT_UTS_MACHINE _INIT_UTS_ISA _INIT_UTS_PLATFORM 650Sstevel@tonic-gate 66*1573Sdp# 67*1573Sdp# Set _INIT_NET_STRATEGY and _INIT_NET_IF variables from /sbin/netstrategy 68*1573Sdp# 69*1573Sdpsmf_netstrategy 700Sstevel@tonic-gate 710Sstevel@tonic-gate 720Sstevel@tonic-gateif [ -d /etc/rc3.d ]; then 730Sstevel@tonic-gate for f in /etc/rc3.d/K*; do 740Sstevel@tonic-gate if [ -s $f ]; then 750Sstevel@tonic-gate case $f in 760Sstevel@tonic-gate *.sh) /lib/svc/bin/lsvcrun -s $f stop ;; 770Sstevel@tonic-gate *) /lib/svc/bin/lsvcrun $f stop ;; 780Sstevel@tonic-gate esac 790Sstevel@tonic-gate fi 800Sstevel@tonic-gate done 810Sstevel@tonic-gate 820Sstevel@tonic-gate for f in /etc/rc3.d/S*; do 830Sstevel@tonic-gate if [ -s $f ]; then 840Sstevel@tonic-gate case $f in 850Sstevel@tonic-gate *.sh) /lib/svc/bin/lsvcrun -s $f start ;; 860Sstevel@tonic-gate *) /lib/svc/bin/lsvcrun $f start ;; 870Sstevel@tonic-gate esac 880Sstevel@tonic-gate fi 890Sstevel@tonic-gate done 900Sstevel@tonic-gatefi 910Sstevel@tonic-gate 92*1573Sdpif smf_is_globalzone; then 930Sstevel@tonic-gate # Unload all the loadable modules brought in during boot 940Sstevel@tonic-gate # Delay a few seconds to allow dtlogin to open console first. 950Sstevel@tonic-gate 960Sstevel@tonic-gate (sleep 5; modunload -i 0) & >/dev/null 2>&1 970Sstevel@tonic-gatefi 98