-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Improve handling early startup issues #219
Conversation
In case the service is stopped while Xorg is still starting up (and gui-agent still waits for the Xorg connectin in mkghandles), gui-agent would exit before killing Xorg and Xorg would try connecting back to the gui-agent forever, delaying the shutdown. Fix this by moving signal registration earlier, before Xorg startup. Since ghandles_for_vchan_reinitialize is now set before its fully initialized, initialize x_pid field explicitly and leave all the other fields zeroed (instead of random stack rubble).
Register proper signal handler for SIGCHLD, and collect the Xorg's zombie in it. This has two effects: 1. The main loop can explicitly exit on Xorg termination, not only via receiving EOF on the socket. 2. Due to not ignoring SIGCHLD anymore, accept() in mkghandles will also notice Xorg early exit and not wait indefinitely (it will fail with EINTR). For this case, improve error message. There is still a small race on startup, if Xorg exits before reaching accept() (or listen()) call. Handle this by checking just before accept() call. It isn't perfect (there is still a few instructions window where it wouldn't notice it in time), but it's good enough for practical purposes. QubesOS/qubes-issues#8060
Use X's logging function instead of plain perror, to ensure the message is written in appropriate Xorg's log.
OpenQA test summaryComplete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2024121004-4.3&flavor=pull-requests Test run included the following:
New failures, excluding unstableCompared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2024111705-4.3&flavor=update
Failed tests4 failures
Fixed failuresCompared to: https://openqa.qubes-os.org/tests/119126#dependencies 2 fixed
Unstable tests
|
If Xorg is going to be terminated, do not try to connect to gui-agent anymore. This avoids infinite loop when handling SIGTERM, and properly shutdown instead.
Better handle stopping the service while it's still starting up. And also improve handling Xorg startup errors (much simpler alternative to #176).