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/cmd-inet/etc/init.d/pppd
+++ new/usr/src/cmd/cmd-inet/etc/init.d/pppd
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 -# Copyright (c) 2000-2001 by Sun Microsystems, Inc.
25 -# All rights reserved.
23 +# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 +# Use is subject to license terms.
26 25 #
27 -#ident "%Z%%M% %I% %E% SMI"
28 26
29 27 PATH=/sbin:/usr/bin:/usr/sbin; export PATH
30 28 PPPDIR=/etc/ppp; export PPPDIR
31 29
32 30 case "$1" in
33 31 'start')
34 32 if [ ! -x /usr/bin/pppd -o ! -c /dev/sppp ]; then
35 33 echo "$0: Solaris PPP has not been correctly installed on"
36 34 echo "$0: this system. Required files are missing."
37 35 exit 1
38 36 fi
39 37 if [ -f $PPPDIR/ifconfig ]; then
40 38 . $PPPDIR/ifconfig
41 39 fi
42 40 if [ -f $PPPDIR/demand ]; then
43 41 . $PPPDIR/demand
44 42 fi
45 43 if [ -f $PPPDIR/pppoe.if ] && [ -x /usr/sbin/sppptun ]; then
46 44 sed -e 's/^#.*//;s/\([^\\]\)#.*/\1/;s/[ ]*$//;s/^[ ]*//' \
47 45 $PPPDIR/pppoe.if | \
48 46 while read intf; do
49 47 if [ "$intf" ]; then
50 48 /usr/sbin/sppptun plumb pppoe $intf
|
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
51 49 /usr/sbin/sppptun plumb pppoed $intf
52 50 fi
53 51 done
54 52 fi
55 53 if [ -f $PPPDIR/pppoe ] && [ -x /usr/lib/inet/pppoed ]; then
56 54 /usr/lib/inet/pppoed >/dev/null
57 55 fi
58 56 ;;
59 57
60 58 'stop')
61 - /usr/bin/pkill -x pppd
62 - sleep 1
63 - /usr/bin/pkill -x pppoed
59 + /usr/bin/pkill -z `/sbin/zonename` -x pppd && sleep 1
60 + /usr/bin/pkill -z `/sbin/zonename` -x pppoed
64 61
65 62 # Use ifconfig to make the interfaces down just in case
66 63 if [ -f $PPPDIR/ifconfig ]; then
67 64 nawk '/ifconfig[ ]*sppp/ { \
68 65 system("ifconfig " $2 " down"); \
69 66 system("ifconfig " $2 " unplumb"); \
70 67 next; \
71 68 } \
72 69 /ifconfig/ { \
73 70 $3 = "removeif"; \
74 71 NF = 4; \
75 72 system($0); \
76 73 }' < $PPPDIR/ifconfig
77 74 fi
78 75
79 76 if [ -f $PPPDIR/pppoe.if ] && [ -x /usr/sbin/sppptun ]; then
80 77 sed -e 's/^#.*//;s/\([^\\]\)#.*/\1/;s/[ ]*$//;s/^[ ]*//' \
81 78 $PPPDIR/pppoe.if | \
82 79 while read intf; do
83 80 if [ "$intf" ]; then
84 81 /usr/sbin/sppptun unplumb ${intf}:pppoe
85 82 /usr/sbin/sppptun unplumb ${intf}:pppoed
86 83 fi
87 84 done
88 85 fi
89 86 ;;
90 87
91 88 *)
92 89 echo "Usage: $0 { start | stop }"
93 90 exit 1
94 91 ;;
95 92 esac
96 93 exit 0
|
↓ open down ↓ |
23 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX