From 55e894884724f292ec2827144edd0c5ad11c5c01 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Tue, 6 Sep 2022 17:44:43 -0700 Subject: [PATCH] [fast-reboot]Avoid stopping masked services during fast-reboot (#2335) #### What I did During fast-reboot there were warnings for few services sudo fast-reboot Warning: The unit file, source configuration file or drop-ins of mux.service changed on disk. Run 'systemctl daemon-reload' to reload units. Dumping conntrack entries failed Warning: The unit file, source configuration file or drop-ins of nat.service changed on disk. Run 'systemctl daemon-reload' to reload units. Warning: The unit file, source configuration file or drop-ins of sflow.service changed on disk. Run 'systemctl daemon-reload' to reload units. Warning: Stopping docker.service, but it can still be activated by: docker.socket Watchdog armed for 180 seconds This is due to the fact that the services are masked and trying to stop them will throw warning systemctl is-enabled sflow.service masked systemctl stop sflow.service Warning: The unit file, source configuration file or drop-ins of sflow.service changed on disk. Run 'systemctl daemon-reload' to reload units. #### How I did it Added check to skip stopping the services in fast-reboot if the services are masked. #### How to verify it Execute fast-reboot with the fix and verify. --- scripts/fast-reboot | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/fast-reboot b/scripts/fast-reboot index 198d3905d0..a3c7486e35 100755 --- a/scripts/fast-reboot +++ b/scripts/fast-reboot @@ -679,6 +679,12 @@ else fi for service in ${SERVICES_TO_STOP}; do + # Skip the masked services + state=$(systemctl is-enabled ${service}) + if [[ $state == "masked" ]]; then + continue + fi + debug "Stopping ${service} ..." # TODO: These exceptions for nat, sflow, lldp