#==============================================================
#
#  Abs:  Startup Script for Shared Platform (dev)
#
#  Name: st.cmd
#
#  Desc: The processor is an Advantech 1U server,
#        SKY-8100 industrial pc/server.
#
#  Side: Core dump settings:
#        NOTE: Either of these settings may cause reliability
#        problems, because generating core files and/or writing
#        them to a network drive takes system resources, which
#        my preempt other processes. FOR DEBUGGING ONLY
#
#        From the command line, start an IOC with non-zero core
#        dump files enabled using the command:
#           "iocConsole.sh -f iocname".
#        To enable non-empty core dump file generation for
#        all IOCs started at system startup, uncomment the next line:
#        export ENABLE_COREDUMP_FILES=1
#
#        Default location for core dump files is /tmp. 
#        To change that, use a line like:
#           echo "/data/${HOSTNAME}/core.%e.%p.%h.%t" > /proc/sys/kernel/core_pattern
#
#  Facility:  EED Shared Platform
#
#  Auth: dd-mmm-yyyy, Author's Name   (USERNAME)
#  Rev:  dd-mmm-yyyy, Reviewer's Name (USERNAME)
#--------------------------------------------------------------
#  Mod:
#        11-Jun-2020, K. Luchini      (LUCHINI):
#         extracted from $EPICS_IOCS/cpu-b34-sp06/kernel-modules.cmd
#         and renamed to st.cmd
#
#==============================================================

# =========================================
# Turn on local IPMI Client support
# =========================================
echo "Load IPMI..."
modprobe ipmi_devintf
ipmitool lan print

# =========================================
# Network configuration
# =========================================
ifconfig eth0 10.26.1.1 netmask 255.255.255.0 up
for PID in  $(ps -elF | grep eth0 | grep -v grep | awk '{print $4}'); do chrt -f -p 84 $PID ; done

# =========================================
# FCOM SETUP
# Dev Mask = 255.255.255.192
# =========================================
ifconfig eth1 172.25.160.40 netmask 255.255.255.192

export FCOMMCGRP="mc-b034-fcom"
route add -net $FCOMMCGRP netmask 255.255.255.192 dev eth1
ip route add 224.0.0.0/4 dev eth1

# Note: the FCOM_MC_PREFIX is different between development and production
# Development: 239.219.248.0
# Production:  239.219.8.0
export FCOM_MC_PREFIX=239.219.248.0

# End of script'


