#!/sbin/sh # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # Copyright (c) 2011, 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 if smf_is_zone_immutable; then echo "Immutable zone not supported" exit $SMF_EXIT_OK fi if [ ! -x /usr/lib/ilomconfig.builtin ]; then echo "/usr/lib/ilomconfig.builtin not found or not executable" exit $SMF_EXIT_ERR_FATAL fi support_failover= IPMITOOL=/usr/sbin/ipmitool case "$1" in 'start') # check if the platform support redundant SP ${IPMITOOL} sunoem getbehavior SUPPORTS_PCIE_ALTERNATE_PATHS 2>&1 | grep "is enabled" > /dev/null if [ "$?" -eq 0 ] ; then support_failover=1 svccfg -s network/ilomconfig-interconnect setprop \ startd/support_failover = boolean: "true" fi /lib/svc/method/svc-ilomconfig-bg $support_failover & ;; 'stop') [ ! -r /system/volatile/interconnect ] && exit $SMF_EXIT_OK x=0 while [ $x -le 2 ] do if [ $x -ne 0 ] ; then sleep 5 fi /usr/lib/ilomconfig.builtin disable 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, or older ILOM version if [[ $ret -eq 3 ]] || [[ $ret -eq 8 ]] || [[ $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 x=$(( $x + 1 )) done # Return OK after all retries attempted [ "$support_failover" -eq 1 ] && touch ${LCK} exit $SMF_EXIT_OK ;; *) echo "Usage: $0 { start | stop }" ;; esac exit $SMF_EXIT_OK