Skip to content

Commit

Permalink
[fast-reboot]Avoid stopping masked services during fast-reboot (sonic…
Browse files Browse the repository at this point in the history
…-net#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.
  • Loading branch information
dgsudharsan authored and EdenGri committed Oct 12, 2022
1 parent 6124ab7 commit 9592ee9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,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
Expand Down

0 comments on commit 9592ee9

Please sign in to comment.