#!/sbin/sh # # Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. . /lib/svc/share/smf_include.sh LCK=/system/volatile/ilomconfig.lock # to mark that svc has run support_failover=$1 MAX_START_RETRIES=4 x=0 while [ $x -le $MAX_START_RETRIES ] do if [ $x -ne 0 ] ; then sleep 20 fi /usr/lib/ilomconfig.builtin enable interconnect ret=$? # Success if [ $ret -eq 0 ] ; then [ "$support_failover" -eq 1 ] && touch ${LCK} exit $SMF_EXIT_OK fi # Return OK on failure if ILOM not supported, older ILOM version, or virtual environmenti, or bmc/kcs is not accessible. if [[ $ret -eq 3 ]] || [[ $ret -eq 32 ]] || [[ $ret -eq 33 ]] || [[ $ret -eq 34 ]] || [[ $ret -eq 79 ]] || [[ $ret -eq 92 ]] || [[ $ret -eq 94 ]] || [[ $ret -eq 96 ]] || [[ $ret -eq 97 ]] || [[ $ret -eq 98 ]] ; then [ "$support_failover" -eq 1 ] && touch ${LCK} exit $SMF_EXIT_OK fi # If the SP is unreachable, disable the interconnect to work around # USB driver issue. The next retry will reenable the interconnect. if [ $ret -eq 74 ] ; then if [ $x -lt $MAX_START_RETRIES ] ; then /usr/lib/ilomconfig.builtin disable interconnect fi fi x=$(( $x + 1 )) done # Return OK after all retries attempted [ "$support_failover" -eq 1 ] && touch ${LCK} exit $SMF_EXIT_OK