5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
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.
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]
23 # Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
26 # ident "%Z%%M% %I% %E% SMI"
30 # Start script for the SPARC-Enterprise DSCP service.
33 .
/lib
/svc
/share
/smf_include.sh
35 OPL
=SUNW
,SPARC-Enterprise
36 OPL_LIB
=/usr
/platform
/${OPL}/lib
37 DM2S_DEVICE
=/dev
/dm2s0
38 PPP_OPTIONS
=${OPL_LIB}/dscp.ppp.options
39 DSCP_IFNAME
=/var
/run
/dscp.ifname
40 PRTDSCP
=/usr
/platform
/${OPL}/sbin
/prtdscp
41 PLATFORM
=`/usr/bin/uname -i`
45 LD_LIBRARY_PATH
=/lib
:${OPL_LIB}; export LD_LIBRARY_PATH
47 # This service can only run on OPL.
48 if [ "${PLATFORM}" != "${OPL}" ]; then
49 exit $SMF_EXIT_ERR_CONFIG
55 if [ ! -x /usr
/bin
/pppd
]; then
56 exit $SMF_EXIT_ERR_CONFIG
59 if [ ! -c $DM2S_DEVICE ]; then
60 exit $SMF_EXIT_ERR_CONFIG
63 if [ ! -f $PPP_OPTIONS ]; then
64 exit $SMF_EXIT_ERR_CONFIG
68 for UNIT
in 0 1 2 3 4 5 6 7 8 9; do
69 /usr
/bin
/pppd
$DM2S_DEVICE unit
$UNIT file $PPP_OPTIONS
70 if [ ! "$?" = "1" ]; then
71 echo "sppp$UNIT" > $DSCP_IFNAME
77 if [ $SUCCESS -ne 1 ]; then
78 exit $SMF_EXIT_ERR_FATAL
81 # Wait for the DSCP link to come up, but only for 30 seconds
82 for RETRY
in 0 1 2 3 4 5; do
83 ${PRTDSCP} >/dev
/null
2>&1
90 # Stop pppd before we return failure
91 ${PKILL} -TERM -f "pppd ${DM2S_DEVICE}"
93 ${PKILL} -KILL -f "pppd ${DM2S_DEVICE}"
95 exit $SMF_EXIT_ERR_FATAL
99 # First try SIGTERM and then SIGKILL
100 ${PKILL} -TERM -f "pppd ${DM2S_DEVICE}"
102 ${PKILL} -KILL -f "pppd ${DM2S_DEVICE}"