Skip to content

Commit 8c07d59

Browse files
authored
[Mellanox] [reboot] [asan] stop asan-enabled containers on reboot (#2107)
During a cold reboot on an image built with ENABLE_ASAN=y, swss and syncd (only on Mellanox platform) are explicitly stopped. This will make the relevant processes receive SIGTERM and generate the ASAN reports. The behavior for fast/warm reboots is not affected. The behavior of regular (ENABLE_ASAN=n) images is not affected. - What I did Modified the reboot script so the asan logs are generated on reboot. - How I did it Added stop_services_asan() to reboot script. - How to verify it Added "asan: 'yes'" to the /etc/sonic/sonic_version.yml Checked that relevant containers are stopped and logs are generated Signed-off-by: Yakiv Huryk <[email protected]>
1 parent 697aae3 commit 8c07d59

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

scripts/reboot

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ REBOOT_USER=$(logname)
2525
PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)
2626
ASIC_TYPE=$(sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type)
2727
SUBTYPE=$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype)
28+
ASAN=$(sonic-cfggen -y /etc/sonic/sonic_version.yml -v asan)
2829
VERBOSE=no
2930
EXIT_NEXT_IMAGE_NOT_EXISTS=4
3031
EXIT_SONIC_INSTALLER_VERIFY_REBOOT=21
@@ -78,6 +79,12 @@ function stop_sonic_services()
7879
stop_pmon_service
7980
}
8081

82+
function stop_services_asan()
83+
{
84+
debug "Stopping swss for ASAN"
85+
systemctl stop swss
86+
}
87+
8188
function clear_warm_boot()
8289
{
8390
# If reboot is requested, make sure the outstanding warm-boot is cleared
@@ -187,6 +194,11 @@ tag_images
187194
# Stop SONiC services gracefully.
188195
stop_sonic_services
189196

197+
# Stop ASAN-enabled services so the report can be generated
198+
if [[ x"$ASAN" == x"yes" ]]; then
199+
stop_services_asan
200+
fi
201+
190202
clear_warm_boot
191203

192204
# Update the reboot cause file to reflect that user issued 'reboot' command

0 commit comments

Comments
 (0)