From de7e5101a8d5cd7d3fe5ff768252dec4d3a7237b Mon Sep 17 00:00:00 2001 From: Stepan Blyschak Date: Tue, 1 Apr 2025 09:06:51 +0000 Subject: [PATCH] [orchagent.sh] mask SIGHUP before starting orchagent logrotate uses SIGHUP to let orchagent rotate SAI Redis recording. If SIGHUP is sent by logrotate before orchagent register its handler the default action takes place - termination. If we mask the signal in the start script orchagent inherits masked signals and will ignore SIGHUP until signal handler is registered. This is a rare race condition observed during 1000 warm-reboot testing. Signed-off-by: Stepan Blyschak --- dockers/docker-orchagent/orchagent.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dockers/docker-orchagent/orchagent.sh b/dockers/docker-orchagent/orchagent.sh index 45571944db3..e82eb198019 100755 --- a/dockers/docker-orchagent/orchagent.sh +++ b/dockers/docker-orchagent/orchagent.sh @@ -69,4 +69,7 @@ else ORCHAGENT_ARGS+="-m $MAC_ADDRESS" fi +# Mask SIGHUP signal to avoid orchagent termination by logrotate before orchagent registers its handler. +trap '' SIGHUP + exec /usr/bin/orchagent ${ORCHAGENT_ARGS}