core,vconsole-setup: treat locking failure as non-fatal #32822
Merged
+5
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Locking of the tty device and then /dev/console was added to synchronize vconsole-setup with other writers to the console. But it turns out that often the locking doesn't work and we carved out various cases where we ignore failure:
It turns out that there's at least one more failure mode: we get -EIO when the console is (mis-)configured to point to an invalid device. E.g. in rhbug#2273069 the reporter has a VM in Proxmox without a virtual console configured and has 'console=tty console=ttyS0' on the kernel cmdline. I couldn't reproduce this under libvirt, but failure with EIO has been reported by at least four users in #30501.
Note that in systemd-vconsole-setup we report this is a hard failure, while in the manager, we only do a debug line. So it's possible that the failure also occured there, causing the rest of the setup of the tty to be skipped without further notice.
Ignore the locking failure, since there's just too many ways it can fail. If we proceed without a lock, we're back to the situation before we started locking, which wasn't too bad. OTOH, skipping setup of the console is problematic for users, and it seems better to try to do the setup without locking.
Fixes #30501, https://bugzilla.redhat.com/show_bug.cgi?id=2273069.