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

Conversation

yxieca
Copy link
Contributor

@yxieca yxieca commented Jan 18, 2018

- What I did
Reboot device with platform specific tool when available.

- How I did it

  • Added a script under /usr/bin/reboot, this script will be executed when reboot is invoked without absolute path.
  • The script checks if /platform_reboot tool is available and executable. If so, use this tool to reboot device.
  • Update fast-reboot to call native Linux reboot with absolute path.

- How to verify it

  • Executed the script on device with platform_reboot available, and the tool was called.
  • Executed the script on device without platform_reboot tool or not with execution permission, Linux native reboot was called.

/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.
Copy link
Contributor

@pavel-shirshov pavel-shirshov left a comment

Choose a reason for hiding this comment

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

OK for me

The platform specific reboot tool could be power cycling.
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

@yxieca yxieca merged commit 26c3709 into sonic-net:master Jan 18, 2018
@yxieca yxieca deleted the reboot_tool branch January 18, 2018 23:53
vdahiya12 pushed a commit to vdahiya12/sonic-utilities that referenced this pull request Jul 23, 2021
…chassis (sonic-net#188)

#### Description
Following sonic-net/sonic-platform-daemons#187 to fix the same issue with other packages

#### Motivation and Context
This is blocking sonic-net/sonic-buildimage#7655

#### How Has This Been Tested?
Unit test
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
35fec8528bbf3fad9451554de16922f8c59dda4 (HEAD -> 201911, origin/201911) [201911]: security update kernel to 4.9.246 (sonic-net#188)
d992e63eee24a6a598e58c8b2b468e5440ae56f0 [ci]: add azure pipeline for 201911 (sonic-net#189)

Signed-off-by: Abhishek Dosi <[email protected]>
mihirpat1 pushed a commit to mihirpat1/sonic-utilities that referenced this pull request Sep 15, 2023
#### Description
xcvrd crashes with the following trace for few media when processing application advertisement.
```
Traceback (most recent call last):
  File "/usr/local/bin/xcvrd", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 1415, in main
    xcvrd.run()
  File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 1363, in run
    self.init()
  File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 1328, in init
    post_port_sfp_dom_info_to_db(is_warm_start, self.stop_event)
  File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 501, in post_port_sfp_dom_info_to_db
    post_port_sfp_info_to_db(logical_port_name, int_tbl[asic_index], transceiver_dict, stop_event)
  File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 293, in post_port_sfp_info_to_db
    port_info_dict = _wrapper_get_transceiver_info(physical_port)
  File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 164, in _wrapper_get_transceiver_info
    return platform_chassis.get_sfp(physical_port).get_transceiver_info()
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform/sfp.py", line 621, in get_transceiver_info
    sfp_application_type_list[i * 4], sfp_application_type_list[i * 4 + 1])
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform_base/sonic_sfp/qsfp_dd.py", line 95, in parse_application
    media_result = sfp_media_type_dict[media_interface]
KeyError: '88'
```

#### Motivation and Context
To fix the crash, check whether the media interface key is present before retrieving the particular key in the dict.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants