mkj/dropbear

The terminal process cannot be closed correctly

vsbc2010 opened this issue · 5 comments

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 commented

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

mkj commented

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

Check f17400e

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

mkj commented

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.

Revert f17400e, then issue solved.