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

The terminal process cannot be closed correctly #264

Closed
vsbc2010 opened this issue Dec 5, 2023 · 5 comments
Closed

The terminal process cannot be closed correctly #264

vsbc2010 opened this issue Dec 5, 2023 · 5 comments
Labels

Comments

@vsbc2010
Copy link

vsbc2010 commented Dec 5, 2023

The terminal process cannot be closed correctly.

My reproduction steps:

  1. open ssh client A and login as root
  2. open ssh client B and login as root, run "tcpdump -i any -n -s 0 -w test.pcap"
  3. close ssh console B.
  4. check with shell from console A "ps -axu | grep tcpdump", then found tcpdump nerver exit
  5. but if close console A , then tcpdump exit
@mkj
Copy link
Owner

mkj commented Dec 5, 2023

Which OS is it? I can't think of anything Dropbear would be doing to cause it

@vsbc2010 vsbc2010 closed this as completed Dec 5, 2023
@vsbc2010 vsbc2010 reopened this Dec 5, 2023
@mkj
Copy link
Owner

mkj commented Dec 6, 2023

If 2020.81 worked OK it could be a similar issue to 544f28a

Thanks for checking, sounds like I should be able to reproduce it

@mkj mkj added the regression label Dec 6, 2023
@vsbc2010
Copy link
Author

vsbc2010 commented Dec 6, 2023

Check f17400e

XShell open with "Duplicate SSH Channel", then get issue

@mkj mkj removed the regression label Dec 6, 2023
@mkj
Copy link
Owner

mkj commented Dec 6, 2023

I think the correct behaviour is for tcpdump to exit. It's running in a PTY, so the kernel sends SIGHUP to any processes in that terminal when the SSH session exits (and closes the master side).

It's probably a bug in Dropbear that multiple-channel-per-session doesn't close the master side (until the whole connection goes away). The behaviour of channel closing is tricky though, so I'm not going to change it right now. I'll leave this issue open though.

If you run nohup tcpdump -i any -n -s 0 -w test.pcap it should run OK when the terminal exits.

@mkj mkj added the bug label Dec 6, 2023
@vsbc2010
Copy link
Author

vsbc2010 commented Dec 9, 2023

Revert f17400e, then issue solved.

@mkj mkj closed this as completed in e28ba1b Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants