Skip to content

[reboot] While rebooting device, execute platform specific reboot tool when available #188

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

Merged
merged 5 commits into from
Jan 18, 2018
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ sync
sleep 1
sync

# Reboot
# Reboot: explicity call Linux native reboot under sbin
echo "Rebooting to $NEXT_SONIC_IMAGE..."
reboot
/sbin/reboot
25 changes: 25 additions & 0 deletions scripts/reboot
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#! /bin/bash

function stop_sonic_services()
{
echo "Stopping sonic services..."
systemctl stop swss
systemctl stop teamd
systemctl stop bgp
systemctl stop lldp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why only four dockers?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snmp docker?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added stop snmp service to the list.

Thanks,
Ying

}

# 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
echo "Rebooting with platform ${PLATFORM} specific tool ..."
${DEVPATH}/${PLATFORM}/${REBOOT}
exit 0
fi

/sbin/reboot $@
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def get_test_suite():
'scripts/port2alias',
'scripts/portconfig',
'scripts/portstat',
'scripts/reboot',
'scripts/teamshow'
],
data_files=[
Expand Down