-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[reboot] While rebooting device, execute platform specific reboot too…
…l when available (#188) * [fast-reboot] Explicitly call Linux native reboot tool * [reboot tool] Reboot device with platform specific tool when available /usr/bin is in front of /sbin in search path. Adding reboot script here will get executed when reboot was called without absolute path. This script will call platform specific reboot tool (name: platform_reboot under device folder) when available. Otherwise, dispatch to native Linux reboot. * [reboot] call sync before calling platform specific reboot tool The platform specific reboot tool could be power cycling. * [reboot] sleep 3 seconds after sync-ing * [reboot] also stop snmp service
- Loading branch information
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#! /bin/bash | ||
|
||
function stop_sonic_services() | ||
{ | ||
echo "Stopping sonic services..." | ||
systemctl stop swss | ||
systemctl stop teamd | ||
systemctl stop bgp | ||
systemctl stop lldp | ||
systemctl stop snmp | ||
} | ||
|
||
# Obtain our platform as we will mount directories with these names in each docker | ||
PLATFORM=`sonic-cfggen -v platform` | ||
|
||
DEVPATH="/usr/share/sonic/device" | ||
REBOOT="platform_reboot" | ||
|
||
if [ -x ${DEVPATH}/${PLATFORM}/${REBOOT} ]; then | ||
stop_sonic_services | ||
sync | ||
sleep 3 | ||
echo "Rebooting with platform ${PLATFORM} specific tool ..." | ||
${DEVPATH}/${PLATFORM}/${REBOOT} | ||
exit 0 | ||
fi | ||
|
||
/sbin/reboot $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters