#!/bin/bash # # Copyright 2003-2018 Broadcom. All Rights Reserved. # The term "Broadcom" refers to Broadcom Limited and/or its subsidiaries. # platform_os=`uname -s` systemd_elxhbamgr=usr/lib/systemd/system/elxhbamgrd.service systemd_elxsnmp=usr/lib/systemd/system/elxsnmpd.service init_elxhbamgr=etc/init.d/elxhbamgrd init_elxsnmp=etc/init.d/elxsnmpd if [ "$platform_os" = "Linux" ]; then INSTALL_DIR="usr/sbin/ocmanager" else INSTALL_DIR="opt/ELXocm" fi if [ "$platform_os" = "Linux" ]; then # for rhel5 and SLES10 SP1 installs, lpfcdfc does not exist ioctl_driver="lpfcdfc" let vmware=`rpm -q vmware-release 2>/dev/null 1>/dev/null ; echo $?` let vmware820=`rpm -qa |grep -i vmware-esx-drivers-scsi-lpfc820 2>/dev/null 1>/dev/null ; echo $?` if [ $vmware820 -eq 0 ] ; then ioctl_driver="lpfc820" elif [ $vmware -eq 0 ] ; then ioctl_driver="lpfc_740" else ioctl_driver="lpfc" fi if [[ `lsmod | grep be2net > /dev/dnull 2>&1` -eq 0 ]] || [[ `lsmod | grep be2iscsi > /dev/null 2>&1` -eq 0 ]]; then be2="be2drivers" fi # Start the server daemon if module loaded if [[ $vmware -eq 0 || $vmware820 -eq 0 ]]; then lpfcdfc_loaded=`vmkload_mod -l | awk '{ print $1 }' | grep "$ioctl_driver"` else lpfcdfc_loaded=`lsmod | awk '{ print $1 }' | grep "$ioctl_driver"` fi if [ "$1" != "-w" ]; then # start the MILI Daemon if [ "$platform_os" = "Linux" ];then elxtmp=0 else # Solaris svcadm enable -st application/elxmilid fi # start the SNMP Daemon if [ -x /${init_elxsnmp} ]; then /${init_elxsnmp} start elif [ -f /${systemd_elxsnmp} ]; then echo "Starting elxsnmpd (via systemctl):" systemctl start elxsnmpd.service fi if [[ $vmware820 -eq 0 ]]; then # Start the Event Daemon if not already started if [[ `ps -eaf | grep elxeventd | grep -v grep | wc -l` -eq 0 ]]; then /etc/init.d/elxeventd start fi fi # start the ocv sensor daemons if necessary if [ -x "/usr/local/elx/ocvsensor/start-sensor" ]; then /usr/local/elx/ocvsensor/start-sensor fi fi # start the OneCommand Management Server last if [ ! -z "$lpfcdfc_loaded" ] || [ ! -z "$be2" ];then if [ -x /${init_elxhbamgr} ]; then /${init_elxhbamgr} start elif [ -f /${systemd_elxhbamgr} ]; then echo "Starting elxhbamgrd (via systemctl):" systemctl start elxhbamgrd.service else echo "Unable to start elxhbamgrd!" fi #else # do not try to start OCManager Remote Management daemon because driver not loaded # CR 83380; do not display message because this could be linux guest install on vmware #echo "" #echo "Not starting OCManager Remote Management daemon because $ioctl_driver driver module not loaded." #echo "Load $ioctl_driver driver module and retry." fi else # [Solaris] if [ "$1" != "-w" ]; then # start the ocv sensor daemons if necessary if [ -x "/opt/elx/OCVsensor/start-sensor" ]; then /opt/elx/OCVsensor/start-sensor fi fi # Start the elxhbamgrd daemons svcadm enable -t application/elxhbamgrd fi exit 0