]> git.ipfire.org Git - thirdparty/systemd.git/commit
core,vconsole-setup: treat locking failure as non-fatal
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 14 May 2024 18:00:48 +0000 (20:00 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 14 May 2024 21:22:41 +0000 (23:22 +0200)
commite9bdbb6bbcd4725171ca1fd0bb4fff83e5338acf
tree1e72c15f5691310272e2654484fbf6ba8534d347
parent9e262ef92e40dc761675055866a421a4a4acc84b
core,vconsole-setup: treat locking failure as non-fatal

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:
- lack of permissions (in the user manager)
- missing device node

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 https://github.com/systemd/systemd/issues/30501,
https://bugzilla.redhat.com/show_bug.cgi?id=2273069.
src/core/execute.c
src/vconsole/vconsole-setup.c