2016-07-26 14:01:58 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-09-22 18:16:26 -05:00
|
|
|
function start_app {
|
|
|
|
orchagent $ORCHAGENT_ARGS &
|
|
|
|
portsyncd $PORTSYNCD_ARGS &
|
|
|
|
intfsyncd &
|
|
|
|
neighsyncd &
|
2016-10-24 16:05:56 -05:00
|
|
|
for file in $SWSSCONFIG_ARGS
|
|
|
|
do
|
|
|
|
swssconfig /etc/swss/config.d/$file
|
|
|
|
sleep 1
|
|
|
|
done
|
2016-09-22 18:16:26 -05:00
|
|
|
}
|
|
|
|
|
2016-09-09 19:53:41 -05:00
|
|
|
function clean_up {
|
2016-09-22 18:16:26 -05:00
|
|
|
pkill -9 orchagent
|
|
|
|
pkill -9 portsyncd
|
|
|
|
pkill -9 intfsyncd
|
|
|
|
pkill -9 neighsyncd
|
2016-09-09 19:53:41 -05:00
|
|
|
service rsyslog stop
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
|
|
|
trap clean_up SIGTERM SIGKILL
|
|
|
|
|
2016-07-26 14:01:58 -05:00
|
|
|
. /host/machine.conf
|
|
|
|
|
2017-02-02 22:34:34 -06:00
|
|
|
HWSKU=`sonic-cfggen -m /etc/sonic/minigraph.xml -v minigraph_hwsku`
|
|
|
|
|
2016-07-26 14:01:58 -05:00
|
|
|
MAC_ADDRESS=`ip link show eth0 | grep ether | awk '{print $2}'`
|
|
|
|
|
|
|
|
ORCHAGENT_ARGS=""
|
|
|
|
|
2017-02-02 22:34:34 -06:00
|
|
|
PORTSYNCD_ARGS="-p /usr/share/sonic/$HWSKU/port_config.ini"
|
2016-07-26 14:01:58 -05:00
|
|
|
|
2016-10-24 16:05:56 -05:00
|
|
|
SWSSCONFIG_ARGS="00-copp.config.json "
|
|
|
|
|
2017-02-02 22:34:34 -06:00
|
|
|
if [ "$HWSKU" == "Force10-S6000" ]; then
|
2016-07-26 14:01:58 -05:00
|
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
2016-10-24 16:05:56 -05:00
|
|
|
SWSSCONFIG_ARGS+="td2.32ports.qos.1.json td2.32ports.qos.2.json td2.32ports.qos.3.json td2.32ports.qos.4.json td2.32ports.qos.5.json td2.32ports.qos.6.json "
|
|
|
|
SWSSCONFIG_ARGS+="td2.32ports.buffers.1.json td2.32ports.buffers.2.json td2.32ports.buffers.3.json "
|
2017-02-02 22:34:34 -06:00
|
|
|
elif [ "$HWSKU" == "Force10-S6100" ]; then
|
2016-12-20 15:29:00 -06:00
|
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
2017-02-02 22:34:34 -06:00
|
|
|
elif [ "$HWSKU" == "Arista-7050-QX32" ]; then
|
2016-10-09 20:05:24 -05:00
|
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
2016-10-24 16:05:56 -05:00
|
|
|
SWSSCONFIG_ARGS+="td2.32ports.qos.1.json td2.32ports.qos.2.json td2.32ports.qos.3.json td2.32ports.qos.4.json td2.32ports.qos.5.json td2.32ports.qos.6.json "
|
|
|
|
SWSSCONFIG_ARGS+="td2.32ports.buffers.1.json td2.32ports.buffers.2.json td2.32ports.buffers.3.json "
|
2017-02-21 15:37:07 -06:00
|
|
|
elif [ "$HWSKU" == "Arista-7060-CX32S" ]; then
|
|
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
2017-02-02 22:34:34 -06:00
|
|
|
elif [ "$HWSKU" == "AS7512" ]; then
|
2016-09-25 23:48:25 -05:00
|
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
2016-07-26 14:01:58 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
service rsyslog start
|
2016-09-25 23:48:25 -05:00
|
|
|
|
2016-09-22 18:16:26 -05:00
|
|
|
while true; do
|
|
|
|
# Check if syncd starts
|
|
|
|
result=`echo -en "SELECT 1\nHLEN HIDDEN" | redis-cli | sed -n 2p`
|
|
|
|
if [ "$result" != "0" ]; then
|
|
|
|
start_app
|
|
|
|
read
|
|
|
|
fi
|
|
|
|
sleep 1
|
|
|
|
done
|