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
Zombie processes and cant reboot/shutdown when --enable-emergency-shell #76
Comments
Hi! :-) Yeah, it's sort of a limitation with that implementation. Finit doesn't run as PID 1 with I will look into your suggestion, but in all honesty I think the best approach would be to improve the documentation around The second part of this report (startx++) I'd prefer if you report separately. Much easier to follow up on. |
The emergency shell is just a Finit debug mode. This patch adresses a concern from GitHub issue #76, with zombie processes in this mode. Emergency shell could be further improved, e.g. informing the real Finit process of each collected child (zombie) to be restarted if needed. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
I've created a branch for improving emergency shell mode a bit, the first patch is in 054baed. The next step will be to update the documentation, to clarify this mode's intended use. Any feedback is welcome. If you want I can also explain a bit more about how it works and its inherent limitations. |
Sorry for my late reply, i'm getting a little busy as the last year in high school has come. Patch is OK(though i still need to reboot manually). And, of course, i'd like to learn more about what happened, never get bored about the fresh. :) |
The forced reboot is still necessary, yes, and services that die are not respawned automatically. At the center of it all is the fact that PID 1 has some "magical" powers since it's the first process started by the kernel and if it crashes the kernel deems the system unsound and usually reboots. This is what the rescue mode rather clumsily tries to avoid. With it enabled the actual Finit process runs as PID 2 and if Finit dies the rescue shell (which is the actual PID 1) is activated. Now, many daemons have a "reparent to init" sort of code, some call This latter collect of children is used by Finit to see if the PID was a service to be respawd, TTY or inetd. If the PID matches any of them (and its conditions is fulfilled) Finit will restart it. When Finit runs as PID 2 this will not be possible unless some extra overhead like IPC between the actual PID 1 and PID 2 is added. Therefore, Hope that explains it a bit more. |
enough, i think, close |
Me again :).
In short, processes that invoked
fork()
are likely to beZ
. Processes closed manually was the same. And by reboot, i mean i can execute the reboot command, but no shutdown progress was shown, no reaction.I have checked the corresponding the code, and i guess,
finit.c:212 if (pid != 0)
andfinit.c:213 waitpid(0...
should be the solution. Because emergency shell should start right after the crash in my view. So someundefined
behavior was executed unexpectedly, that's what i though.That's all.
The text was updated successfully, but these errors were encountered: