Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[syncd] extend syncd service script to support both warm/cold shutdown #2238

Merged
merged 1 commit into from
Nov 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions files/scripts/syncd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,21 @@ stop() {
debug "Warm boot flag: ${SERVICE} ${WARM_BOOT}."

if [[ x"$WARM_BOOT" == x"true" ]]; then
debug "Warm shutdown syncd process ..."
/usr/bin/docker exec -i syncd /usr/bin/syncd_request_shutdown --warm
TYPE=warm
else
TYPE=cold
fi

# wait until syncd quits gracefully
while docker top syncd | grep -q /usr/bin/syncd; do
sleep 0.1
done
debug "${TYPE} shutdown syncd process ..."
/usr/bin/docker exec -i syncd /usr/bin/syncd_request_shutdown --${TYPE}

/usr/bin/docker exec -i syncd /bin/sync
debug "Finished warm shutdown syncd process ..."
fi
# wait until syncd quits gracefully
while docker top syncd | grep -q /usr/bin/syncd; do
sleep 0.1
done

/usr/bin/docker exec -i syncd /bin/sync
debug "Finished ${TYPE} shutdown syncd process ..."

/usr/bin/${SERVICE}.sh stop
debug "Stopped ${SERVICE} service..."
Expand Down