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

Manually send SIGHUP to vtysh when the current session was disconnected #1801

Merged
merged 2 commits into from
Jun 20, 2018

Conversation

pavel-shirshov
Copy link
Contributor

- What I did
I added a logic to send SIGHUP to running vtysh in bgp container. Otherwise it will run in the container indefinitely long. This PR is fix for the previous #1792: which broke autocompletion in vtysh.

- How I did it

  1. Get current tty for the session.
  2. Register signal handler for bash running in host os
  3. Send SIGHUP to the vtysh process which was run by current TTY session

- How to verify it
Run vtysh and disconnect from the console. When you connect back, you'll not find any vtysh instances.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

function cleanup
{
PID_FOR_HUP=$(docker exec -i bgp ps a | grep "vtysh $TTY" | awk '{print $1; }')
docker exec -i bgp kill -HUP $PID_FOR_HUP
Copy link
Collaborator

@qiluo-msft qiluo-msft Jun 19, 2018

Choose a reason for hiding this comment

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

Use 'pkill'? #Closed

@pavel-shirshov pavel-shirshov merged commit bbca583 into sonic-net:master Jun 20, 2018
@pavel-shirshov pavel-shirshov deleted the pavelsh/vtysh_next branch June 20, 2018 19:15
judyjoseph added a commit that referenced this pull request Oct 21, 2021
25f7c79 [sonic-package-manager] remove make_python_identifier (#1801)
84a7602 [sonic-package-manager] stop service explicitelly before uninstalling package (#1805)
wen587 added a commit that referenced this pull request Oct 26, 2021
8ea834b [sonic_installer] Change sonic_installer check ASIC mismatch by platforms list (#1836)
9017d99 Fix the option missing in kernel config issue (#1888)
6595ad4 [mlag] fix log print sequence (#1730)
e600e1c CLI command to load config in Yang format (#1781)
00948d0 Fix the target db version of portchannel-key test (#1842)
6412fea [sonic-package-manager] remove make_python_identifier (#1801)
f738818 [sonic-package-manager] stop service explicitelly before uninstalling package (#1805)
d8ee5e9 Remove exec from platform_reboot_plugin call to handle any hang issue. (#1879)
827fcee [chassis][routecheck]filter out the chassis internal interfaces (#1798)
4d732c6 [generic_config_updater] Logging (#1864)
25bb184 [config]: Add loopback interfaces to interface name checker (#1869)
c950a55 Validate input of config mirror_session add (#1825)
9ab20fd [show][config] fix the muxcable commands for interface naming mode (#1862)
476b3a4 [multi-asic][cli][chassis-db] Avoid connecting to chassis db for cli commands executed from linecard (#1707)
taras-keryk pushed a commit to taras-keryk/sonic-buildimage that referenced this pull request Apr 28, 2022
#### What I did

It is not needed to make a CLI plugin name with valid python identifier. It is also possible that make_python_identifier will return same filename for two different packages.

#### How I did it

Removed make_python_identifier.

#### How to verify it

Install package with CLI plugin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants