8246905af07f741a739c4add8da2c4ade0f20fcf
This patch is a new attempt to fix the race originally described in issue #9754. The initial fix (commitad96887a12) consisted in spawning a sub process that became the controlling process of the VT and hence kicked the old controlling process off to make sure that the VT wouldn't have entered in HUP state while logind restored the VT. But it introduced a regression (see issue #11269) and thus was reverted. But unlike it was described in the revert commit message, commitadb8688b3falone doen't fix the initial race. This patch fixes the race in a simpler way by trying to restore the VT a second time after making sure to re-open it if the first attempt fails. Indeed if the old controlling process dies before or during the first attempt, logind will fail to restore the VT. At this point the VT is in HUP state but we're sure that it won't enter in a HUP state a second time. Therefore we will retry by re-opening the VT to clear the HUP state and by restoring the VT a second time, which should be safe this time. Fixes: #9754 Fixes: #13241
…
systemd - System and Service Manager
Details
General information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list or join our IRC channel.
Stable branches with backported patches are available in the stable repo.
Languages
C
88.5%
Shell
5.7%
Python
4.6%
Meson
1.1%