From b100ec559ef7e56fec1efa07209465b2b1b3d5f1 Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Mon, 20 Jul 2020 07:50:26 +0300 Subject: [PATCH] [services] remove swss from WantedBy for nat service (#4991) Otherwise, it may cause issues for warm restarts, warm reboot. Warm restart of swss will start nat which is not expected for warm restart. Also it is observed that during warm-reboot script execution nat container gets started after it was killed. This causes removal of nat dump generated by nat previously: A check [ -f /host/warmboot/nat/nat_entries.dump ] || echo "NAT dump does not exists" was added right before kexec: ``` Fri Jul 17 10:47:16 UTC 2020 Prepare MLNX ASIC to fastfast-reboot: install new FW if required Fri Jul 17 10:47:18 UTC 2020 Pausing orchagent ... Fri Jul 17 10:47:18 UTC 2020 Stopping nat ... Fri Jul 17 10:47:18 UTC 2020 Stopped nat ... Fri Jul 17 10:47:18 UTC 2020 Stopping radv ... Fri Jul 17 10:47:19 UTC 2020 Stopping bgp ... Fri Jul 17 10:47:19 UTC 2020 Stopped bgp ... Fri Jul 17 10:47:21 UTC 2020 Initialize pre-shutdown ... Fri Jul 17 10:47:21 UTC 2020 Requesting pre-shutdown ... Fri Jul 17 10:47:22 UTC 2020 Waiting for pre-shutdown ... Fri Jul 17 10:47:24 UTC 2020 Pre-shutdown succeeded ... Fri Jul 17 10:47:24 UTC 2020 Backing up database ... Fri Jul 17 10:47:25 UTC 2020 Stopping teamd ... Fri Jul 17 10:47:25 UTC 2020 Stopped teamd ... Fri Jul 17 10:47:25 UTC 2020 Stopping syncd ... Fri Jul 17 10:47:35 UTC 2020 Stopped syncd ... Fri Jul 17 10:47:35 UTC 2020 Stopping all remaining containers ... Warning: Stopping telemetry.service, but it can still be activated by: telemetry.timer Fri Jul 17 10:47:37 UTC 2020 Stopped all remaining containers ... NAT dump does not exists Fri Jul 17 10:47:39 UTC 2020 Rebooting with /sbin/kexec -e to SONiC-OS-201911.140-08245093 ... ``` With this change, executed warm-reboot 10 times without hitting this issue, while without this change the issue is easily reproducible almost every warm-reboot run. Signed-off-by: Stepan Blyschak --- files/build_templates/nat.service.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/build_templates/nat.service.j2 b/files/build_templates/nat.service.j2 index 4a0e20efae..1d267cfe93 100644 --- a/files/build_templates/nat.service.j2 +++ b/files/build_templates/nat.service.j2 @@ -15,5 +15,5 @@ Restart=always RestartSec=30 [Install] -WantedBy=multi-user.target swss.service +WantedBy=multi-user.target