-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Terminal] Dead bash processes stack up when navigating away #24
Comments
It's not locked up, the main thread waits for both the reader and writer to die before closing the terminal. The leftover bash process is a "Zombie" (You can see this in the htop "state" column). From the docs:
However, bash won't let us "wait" on it to stop, so it stays around. |
Do I get it right that bash is currently stopped by sending an Probably there is a cleaner way, like exit from within bash and then "wait", or sending a SIGTERM and "wait". Here another docs page on this: https://docs.rs/tokio/1.13.0/tokio/process/index.html#unix-processes And here a SIGTERM method from the Tokio signal module: https://docs.rs/tokio/1.13.0/tokio/signal/unix/struct.SignalKind.html#method.terminate Another find on this: tokio-rs/tokio#2504 |
I'm not using Tokio however, just EDIT: Ah, it looks like |
Ah right. Do I get it right that this implies std:process:Child? Basically the same, it can
EDIT:
Worth a test. Probably in combination with |
I figured it out. I was writing the |
Perfect 👍. |
Whenever navigating to and away from the Terminal page, the
bash
process is not really killed, but remains in the process list with zero memory usage and no ability to kill it (SIGKILL has no effect). This stacks up with every Terminal visit:Not sure if probably the reader loop locks it up when still reading the socket? I do no yet fully understand at which points the loops are exited when the page is changed: https://github.com/ravenclaw900/DietPi-Dashboard/blob/main/src/backend/src/terminal.rs
The text was updated successfully, but these errors were encountered: