Aetf / kmscon

Linux KMS/DRM based virtual Console Emulator
http://www.freedesktop.org/wiki/Software/kmscon
Other
174 stars 26 forks source link

Freeze issue on logout / CTRL+d #82

Open ItachiSan opened 2 months ago

ItachiSan commented 2 months ago

Hi, I want to report my current issue using KMSCon.

Version

Latest Git commit installed via the AUR package kmscon-patched-git.

OS

ArchLinux, latest updates as of today (2024-07-01)

What should happen

When logging out from a TTY which uses KMSCon, I expect to be asked for credentials again.

What happens instead

When using either CTRL+d or logout, the shell freezes and I am unable to do anything. The best way I found for resetting it is to jump to another terminal and kill the hang up kmscon process.

Other information

Not sure what can help, ping me here and I can provide any sort of logs and sort

ItachiSan commented 2 months ago

Even exit causes the issue.

grepsuzette commented 1 month ago

same problem

Cloudwalk9 commented 1 month ago

You have to comment out ERASECHAR in /etc/login.defs, otherwise backspace and auto-restart of the login prompt both break.

EDIT: Huh, seems to only happen on the first KMSCON instance that's launched, but not on subsequent instances.

Cloudwalk9 commented 1 month ago

Seems to happen completely randomly. I have no idea how or why. Sometimes it'll reset the VT, other times it will hang. I'm thinking a race condition, but with what? bash exits, login session terminates, and somehow, sometimes, agetty isn't getting the hint that the session ended.

dimitry-ishenko commented 1 week ago

It happens all the time for me on Ubuntu 24.04, which uses:

kmscon 9.0.0
libtms4 4.0.2
michael-oberpriller commented 1 day ago

It seems to be normal behavior for the login command to exit. KMSCON currently has no way to restart the login process after this happens. The reason this doesn't occur in regular ttys is because they use the init process with getty to start the login process on the tty. The init process then can handle when the login exits and automatically restart it. I think it would be best for KMSCON to mimic this behavior. The changes needed for this functionality are to allow using the pty name in the login command through a specifier like %p and another config option for a command to be run when a terminal is closed. This allows the login command to start an init service with the pty name as an argument. The service could then use getty with the pty name to start the process on the correct terminal. The exit command would then be used to stop the init service when it is no longer needed. This is the best approach I could think of, but let me know if there is a better solution.