The terminal process cannot be closed correctly
vsbc2010 opened this issue · 5 comments
The terminal process cannot be closed correctly.
My reproduction steps:
- open ssh client A and login as root
- open ssh client B and login as root, run "tcpdump -i any -n -s 0 -w test.pcap"
- close ssh console B.
- check with shell from console A "ps -axu | grep tcpdump", then found tcpdump nerver exit
- but if close console A , then tcpdump exit
Which OS is it? I can't think of anything Dropbear would be doing to cause it
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
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.