Closed liuming50 closed 8 months ago
Which commands exactly did you use to initiate the shutdown/reboot?
I was using reboot which symlinks to initctl. Sending a couple newlines on the console will allow the reboot to proceed.
I was thinking it was related to the fact that ttinit sets attributes for STDERR_FILENO while the scanf requires raw (?) input from stdin. However, simply applying the same cflag/lflag on STDIN_FILENO was not sufficient to resolve the hang in every situation - if nobody logged in on the console it still hangs.
Yeah this is not right. I'll have a look at it. The reboot command should bypass all terminal screen probing
OK, I believe I've identified the root cause: https://github.com/troglobit/finit/blob/5998342b3e55638b0f7248383e939a64f53fa8ff/src/log.c#L54-L64
At shutdown all subsystems are called to exit, so too the logging subsystem. Pretty sure this is the instance of ttinit()
you run into. Could you verify by removing or commenting out lines 60 & 61?
I'll have a chat with a colleague, but we'll likely just drop those two lines. No point in probing screen at shutdown anymore. ([OK] progress is displayed differently these days.)
I have verified it, it works on our system. Thanks for the quick feedback!
I have verified it, it works on our system. Thanks for the quick feedback!
Great, thanks! :smiley::+1:
I'll push an official fix later today, which will be part of the next release.
We observed a issue that finit hangs during system shutting down, when there is a serial debug console connected to the machine.
After some investigation, we found it hangs on this line: https://github.com/troglobit/finit/blob/master/src/util.c#L620