Print this page
6805730 some simple changes would make 'init 5' much faster
6809492 startd shouldn't let hung subprocesses impede shutdown
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/cmd/initpkg/rc0.sh
+++ new/usr/src/cmd/initpkg/rc0.sh
1 1 #!/sbin/sh
2 2 #
3 3 # CDDL HEADER START
4 4 #
5 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 8 #
10 9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 10 # or http://www.opensolaris.org/os/licensing.
12 11 # See the License for the specific language governing permissions
13 12 # and limitations under the License.
14 13 #
15 14 # When distributing Covered Code, include this CDDL HEADER in each
16 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 16 # If applicable, add the following below this CDDL HEADER, with the
18 17 # fields enclosed by brackets "[]" replaced with your own identifying
19 18 # information: Portions Copyright [yyyy] [name of copyright owner]
20 19 #
21 20 # CDDL HEADER END
22 21 #
23 22 #
24 23 # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
25 24 # All rights reserved.
26 25 #
27 26 #
28 -# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
27 +# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
29 28 # Use is subject to license terms.
30 29 #
31 -#ident "%Z%%M% %I% %E% SMI"
32 30
33 31 # "Run Commands" for init states 0, 5 and 6.
34 32
35 33 PATH=/usr/sbin:/usr/bin
36 34
37 35 if [ -z "$SMF_RESTARTER" ]; then
38 36 echo "Cannot be run outside smf(5)"
39 37 exit 1
40 38 fi
41 39
42 40 # Export boot parameters to rc scripts
43 41
44 42 set -- `/usr/bin/who -r`
45 43
46 44 _INIT_RUN_LEVEL="$7" # Current run-level
47 45 _INIT_RUN_NPREV="$8" # Number of times previously at current run-level
48 46 _INIT_PREV_LEVEL="$9" # Previous run-level
49 47
50 48 set -- `/usr/bin/uname -a`
51 49
52 50 _INIT_UTS_SYSNAME="$1" # Operating system name (uname -s)
53 51 _INIT_UTS_NODENAME="$2" # Node name (uname -n)
54 52 _INIT_UTS_RELEASE="$3" # Operating system release (uname -r)
55 53 _INIT_UTS_VERSION="$4" # Operating system version (uname -v)
56 54 _INIT_UTS_MACHINE="$5" # Machine class (uname -m)
57 55 _INIT_UTS_ISA="$6" # Instruction set architecture (uname -p)
58 56 _INIT_UTS_PLATFORM="$7" # Platform string (uname -i)
59 57
60 58 export _INIT_RUN_LEVEL _INIT_RUN_NPREV _INIT_PREV_LEVEL \
61 59 _INIT_UTS_SYSNAME _INIT_UTS_NODENAME _INIT_UTS_RELEASE _INIT_UTS_VERSION \
62 60 _INIT_UTS_MACHINE _INIT_UTS_ISA _INIT_UTS_PLATFORM
63 61
64 62 if [ -d /etc/rc0.d ]; then
65 63 for f in /etc/rc0.d/K*; do
66 64 if [ -s $f ]; then
67 65 case $f in
68 66 *.sh) /lib/svc/bin/lsvcrun -s $f stop;;
69 67 *) /lib/svc/bin/lsvcrun $f stop;;
70 68 esac
71 69 fi
72 70 done
73 71
74 72 # System cleanup functions ONLY (things that end fast!)
75 73
76 74 for f in /etc/rc0.d/S*; do
77 75 if [ -s $f ]; then
78 76 case $f in
|
↓ open down ↓ |
37 lines elided |
↑ open up ↑ |
79 77 *.sh) /lib/svc/bin/lsvcrun -s $f start;;
80 78 *) /lib/svc/bin/lsvcrun $f start ;;
81 79 esac
82 80 fi
83 81 done
84 82 fi
85 83
86 84 [ -f /etc/.dynamic_routing ] && /usr/bin/rm -f /etc/.dynamic_routing
87 85
88 86 trap "" 15
89 -
90 -[ -x /usr/lib/acct/closewtmp ] && /usr/lib/acct/closewtmp
91 -/sbin/sync; /sbin/sync; /sbin/sync
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX