Print this page
7928 Add support for SMF_EXIT_TEMP_TRANSIENT
   1 #!/sbin/sh
   2 #
   3 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
   4 # Use is subject to license terms.
   5 #


   6 # CDDL HEADER START
   7 #
   8 # The contents of this file are subject to the terms of the
   9 # Common Development and Distribution License (the "License").
  10 # You may not use this file except in compliance with the License.
  11 #
  12 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  13 # or http://www.opensolaris.org/os/licensing.
  14 # See the License for the specific language governing permissions
  15 # and limitations under the License.
  16 #
  17 # When distributing Covered Code, include this CDDL HEADER in each
  18 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  19 # If applicable, add the following below this CDDL HEADER, with the
  20 # fields enclosed by brackets "[]" replaced with your own identifying
  21 # information: Portions Copyright [yyyy] [name of copyright owner]
  22 #
  23 # CDDL HEADER END
  24 #
  25 # Start script for vntsd


 127 fi
 128 
 129 auth=`$SVCPROP -p vntsd/authorization $SMF_FMRI 2>/dev/null`
 130 if [ "$auth" = "true" ]; then
 131         args="$args -A"
 132 fi
 133 
 134 #
 135 # If we don't have a vcc device we don't want to try to start vntsd. By default
 136 # newer versions of the factory settings will try to start vntsd by default.
 137 # Since we may be installed on a machine with an older firmware we need to make
 138 # sure that we don't try to start if the virtual console concentrator is not
 139 # present.
 140 #
 141 VNTSD_DEV='/devices/virtual-devices@100/channel-devices@200/virtual-console-concentrator@0:ctl'
 142 if [ ! -c "$VNTSD_DEV" ]; then
 143         echo "The Virtual Network Terminal Server service has been disabled" \
 144             "because the system has no virtual console concentrator (vcc)" \
 145             "device."
 146         /usr/sbin/svcadm disable -t "$SMF_FMRI"
 147         sleep 5 &
 148         exit $SMF_EXIT_OK
 149 fi
 150 
 151 if [ -x /usr/lib/ldoms/vntsd ]; then
 152     /usr/lib/ldoms/vntsd $args
 153     rc=$?
 154     if [ $rc -ne 0 ]; then
 155         # if vntsd exited in error with status 1, let SMF restart it
 156         # otherwise we want it to go into maintenance.
 157         if [ $rc -eq 1 ]; then
 158             exit $SMF_ERR_OTHER
 159         else
 160             exit $SMF_ERR_FATAL
 161         fi
 162     fi
 163 else
 164     echo "WARNING: /usr/lib/ldoms/vntsd is missing or not executable" >& 2
 165     exit $SMF_EXIT_ERR_CONFIG
 166 fi
 167 
 168 exit $SMF_EXIT_OK
   1 #!/sbin/sh
   2 #
   3 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
   4 # Use is subject to license terms.
   5 #
   6 # Copyright 2017 RackTop Systems.
   7 #
   8 # CDDL HEADER START
   9 #
  10 # The contents of this file are subject to the terms of the
  11 # Common Development and Distribution License (the "License").
  12 # You may not use this file except in compliance with the License.
  13 #
  14 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  15 # or http://www.opensolaris.org/os/licensing.
  16 # See the License for the specific language governing permissions
  17 # and limitations under the License.
  18 #
  19 # When distributing Covered Code, include this CDDL HEADER in each
  20 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  21 # If applicable, add the following below this CDDL HEADER, with the
  22 # fields enclosed by brackets "[]" replaced with your own identifying
  23 # information: Portions Copyright [yyyy] [name of copyright owner]
  24 #
  25 # CDDL HEADER END
  26 #
  27 # Start script for vntsd


 129 fi
 130 
 131 auth=`$SVCPROP -p vntsd/authorization $SMF_FMRI 2>/dev/null`
 132 if [ "$auth" = "true" ]; then
 133         args="$args -A"
 134 fi
 135 
 136 #
 137 # If we don't have a vcc device we don't want to try to start vntsd. By default
 138 # newer versions of the factory settings will try to start vntsd by default.
 139 # Since we may be installed on a machine with an older firmware we need to make
 140 # sure that we don't try to start if the virtual console concentrator is not
 141 # present.
 142 #
 143 VNTSD_DEV='/devices/virtual-devices@100/channel-devices@200/virtual-console-concentrator@0:ctl'
 144 if [ ! -c "$VNTSD_DEV" ]; then
 145         echo "The Virtual Network Terminal Server service has been disabled" \
 146             "because the system has no virtual console concentrator (vcc)" \
 147             "device."
 148         /usr/sbin/svcadm disable -t "$SMF_FMRI"
 149         exit $SMF_EXIT_TEMP_TRANSIENT

 150 fi
 151 
 152 if [ -x /usr/lib/ldoms/vntsd ]; then
 153     /usr/lib/ldoms/vntsd $args
 154     rc=$?
 155     if [ $rc -ne 0 ]; then
 156         # if vntsd exited in error with status 1, let SMF restart it
 157         # otherwise we want it to go into maintenance.
 158         if [ $rc -eq 1 ]; then
 159             exit $SMF_ERR_OTHER
 160         else
 161             exit $SMF_ERR_FATAL
 162         fi
 163     fi
 164 else
 165     echo "WARNING: /usr/lib/ldoms/vntsd is missing or not executable" >& 2
 166     exit $SMF_EXIT_ERR_CONFIG
 167 fi
 168 
 169 exit $SMF_EXIT_OK