I connected to Linux (in the case here, I used Ubuntu 1604) by serial console.
Now, the serial console is closed (terminated), but, when I connect back to the serial port again I saw all the sessions are left there.
How can I configure Linux to detect my serial console is terminated and logout me automatically?
I expect the application which monitor the serial port should send
bash or someone else and kill/stop all processes and close my session.