Add support for platform syncd pre shutdown plugin (#13564)
Why I did it Vendor platform may require running platform specific pre-shutdown routine before shutting down the syncd process which runs the SAI and vendor sdk instance. How I did it Added a platform script hook which will be executed if the plugin script is provided by the platform in device//plugins/
This commit is contained in:
parent
860bc7492a
commit
4a93e4cfa4
@ -105,6 +105,12 @@ function stopplatform1() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ x$sonic_asic_platform != x"mellanox" ]] || [[ x$TYPE != x"cold" ]]; then
|
if [[ x$sonic_asic_platform != x"mellanox" ]] || [[ x$TYPE != x"cold" ]]; then
|
||||||
|
# Invoke platform specific pre shutdown routine.
|
||||||
|
PLATFORM=`$SONIC_DB_CLI CONFIG_DB hget 'DEVICE_METADATA|localhost' platform`
|
||||||
|
PLATFORM_PRE_SHUTDOWN="/usr/share/sonic/device/$PLATFORM/plugins/syncd_request_pre_shutdown"
|
||||||
|
[ -f $PLATFORM_PRE_SHUTDOWN ] && \
|
||||||
|
/usr/bin/docker exec -i syncd$DEV /usr/share/sonic/platform/plugins/syncd_request_pre_shutdown --${TYPE}
|
||||||
|
|
||||||
debug "${TYPE} shutdown syncd process ..."
|
debug "${TYPE} shutdown syncd process ..."
|
||||||
/usr/bin/docker exec -i syncd$DEV /usr/bin/syncd_request_shutdown --${TYPE}
|
/usr/bin/docker exec -i syncd$DEV /usr/bin/syncd_request_shutdown --${TYPE}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user