From 733d72339180f21a5fa7898946bc88f4c9cfc896 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Tue, 3 Oct 2017 23:07:40 +0000 Subject: [PATCH 1/3] Make supervisor controlled one-shot program autorestart 0 time, so the status will become FATAL instead of EXITED if failure happens Signed-off-by: Qi Luo --- dockers/docker-orchagent/supervisord.conf | 3 ++- dockers/docker-orchagent/swssconfig.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dockers/docker-orchagent/supervisord.conf b/dockers/docker-orchagent/supervisord.conf index a04238472c4c..43ced2ce74d9 100644 --- a/dockers/docker-orchagent/supervisord.conf +++ b/dockers/docker-orchagent/supervisord.conf @@ -55,7 +55,8 @@ stderr_logfile=syslog command=/usr/bin/swssconfig.sh priority=7 autostart=false -autorestart=false +autorestart=unexpected +startretries=1 stdout_logfile=syslog stderr_logfile=syslog diff --git a/dockers/docker-orchagent/swssconfig.sh b/dockers/docker-orchagent/swssconfig.sh index 7b22fe7d190d..a0793a990078 100755 --- a/dockers/docker-orchagent/swssconfig.sh +++ b/dockers/docker-orchagent/swssconfig.sh @@ -46,7 +46,7 @@ elif [ "$HWSKU" == "Force10-S6000-Q32" ]; then elif [ "$HWSKU" == "Arista-7050-QX32" ]; then SWSSCONFIG_ARGS+="td2.32ports.buffers.json td2.32ports.qos.json " elif [[ "$HWSKU" == "ACS-MSN27"* ]]; then - sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/msn27xx.32ports.buffers.json.j2 > /etc/swss/config.d/msn27xx.32ports.buffers.json + sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/msn27xx.32ports.buffers.json.j2 > /etc/swss/config.d/msn27xx.32ports.buffers.json || exit 1 SWSSCONFIG_ARGS+="msn27xx.32ports.buffers.json msn2700.32ports.qos.json " fi From ffac48310034e5368f4ee3bcb31f2d890c668e86 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Tue, 3 Oct 2017 23:33:22 +0000 Subject: [PATCH 2/3] Make swssconfig.sh strictly exit on any failure Signed-off-by: Qi Luo --- dockers/docker-orchagent/swssconfig.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dockers/docker-orchagent/swssconfig.sh b/dockers/docker-orchagent/swssconfig.sh index a0793a990078..55a22c5353c8 100755 --- a/dockers/docker-orchagent/swssconfig.sh +++ b/dockers/docker-orchagent/swssconfig.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e + function config_acl { if [ -f "/etc/sonic/acl.json" ]; then mkdir -p /etc/swss/config.d/acl @@ -46,7 +48,7 @@ elif [ "$HWSKU" == "Force10-S6000-Q32" ]; then elif [ "$HWSKU" == "Arista-7050-QX32" ]; then SWSSCONFIG_ARGS+="td2.32ports.buffers.json td2.32ports.qos.json " elif [[ "$HWSKU" == "ACS-MSN27"* ]]; then - sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/msn27xx.32ports.buffers.json.j2 > /etc/swss/config.d/msn27xx.32ports.buffers.json || exit 1 + sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/msn27xx.32ports.buffers.json.j2 > /etc/swss/config.d/msn27xx.32ports.buffers.json SWSSCONFIG_ARGS+="msn27xx.32ports.buffers.json msn2700.32ports.qos.json " fi From 57ccac21dd93069b96d89df7bc0fc2a2852388d8 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Wed, 4 Oct 2017 00:07:35 +0000 Subject: [PATCH 3/3] Tune startretries, tested in supervisor 3.3.2-1 Signed-off-by: Qi Luo --- dockers/docker-orchagent/supervisord.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-orchagent/supervisord.conf b/dockers/docker-orchagent/supervisord.conf index 43ced2ce74d9..09850b13d4a1 100644 --- a/dockers/docker-orchagent/supervisord.conf +++ b/dockers/docker-orchagent/supervisord.conf @@ -56,7 +56,7 @@ command=/usr/bin/swssconfig.sh priority=7 autostart=false autorestart=unexpected -startretries=1 +startretries=0 stdout_logfile=syslog stderr_logfile=syslog