@@ -377,18 +377,30 @@ docker exec -i bgp pkill -9 zebra
377
377
docker exec -i bgp pkill -9 bgpd || [ $? == 1 ]
378
378
debug " Stopped bgp ..."
379
379
380
- # Kill lldp, otherwise it sends informotion about reboot
380
+ # Kill lldp, otherwise it sends informotion about reboot.
381
+ # We call `docker kill lldp` to ensure the container stops as quickly as possible,
382
+ # then immediately call `systemctl stop lldp` to prevent the service from
383
+ # restarting the container automatically.
381
384
docker kill lldp > /dev/null
385
+ systemctl stop lldp
382
386
383
387
if [[ " $REBOOT_TYPE " = " fast-reboot" ]]; then
384
388
# Kill teamd, otherwise it gets down all LAGs
389
+ # We call `docker kill teamd` to ensure the container stops as quickly as possible,
390
+ # then immediately call `systemctl stop teamd` to prevent the service from
391
+ # restarting the container automatically.
385
392
# Note: teamd must be killed before syncd, because it will send the last packet through CPU port
386
393
# TODO: stop teamd gracefully to allow teamd to send last valid update to be sure we'll have 90 seconds reboot time
387
394
docker kill teamd > /dev/null
395
+ systemctl stop teamd
388
396
fi
389
397
390
- # Kill swss dockers
398
+ # Kill swss Docker container
399
+ # We call `docker kill swss` to ensure the container stops as quickly as possible,
400
+ # then immediately call `systemctl stop swss` to prevent the service from
401
+ # restarting the container automatically.
391
402
docker kill swss > /dev/null
403
+ systemctl stop swss
392
404
393
405
# Pre-shutdown syncd
394
406
if [[ " $REBOOT_TYPE " = " warm-reboot" || " $REBOOT_TYPE " = " fastfast-reboot" ]]; then
@@ -425,7 +437,13 @@ systemctl stop syncd
425
437
debug " Stopped syncd ..."
426
438
427
439
# Kill other containers to make the reboot faster
428
- docker ps -q | xargs docker kill > /dev/null
440
+ # We call `docker kill ...` to ensure the container stops as quickly as possible,
441
+ # then immediately call `systemctl stop ...` to prevent the service from
442
+ # restarting the container automatically.
443
+ for CONTAINER_NAME in $( docker ps --format ' {{.Names}}' ) ; do
444
+ docker kill $CONTAINER_NAME > /dev/null
445
+ systemctl stop $CONTAINER_NAME
446
+ done
429
447
430
448
# Stop the docker container engine. Otherwise we will have a broken docker storage
431
449
systemctl stop docker.service
0 commit comments