I start agetty using /sbin/agetty 115200 /dev/ttyS2 vt220 to provide console access through my port ttyS2.

From the other computer, I can create a connection, and upon opening, I am prompted with the login console.

However, if I close the connection and just kill -9 $PID the agetty and then restart it, and then reconnect, I'm left with where I had left things, with the existing session still active. I need to fully terminate agetty and log out the session that it launched. If another connection opens up, I want the login prompt again.

So how do I cleanly terminate agetty?

  • To clarify, you're able to kill agetty, but you want it to log out any session as it dies? – Jeff Schaller Feb 6 '16 at 1:47
  • Exactly. I want the sessions associated agetty to die as well. – Kousha Feb 6 '16 at 1:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.