- Package:
- console-setup
- Source:
- console-setup
- Submitter:
- Ognyan Kulev
- Date:
- 2023-09-20 11:27:03 UTC
- Severity:
- important
On a Debian testing inside virt-manager, console-setup always fails on
boot with the following error messages:
Unit console-screen.service could not be found.
● console-setup.service - Set console font and keymap
Loaded: loaded (/lib/systemd/system/console-setup.service; enabled;
vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2016-11-29 11:28:36
EET; 6h ago
Main PID: 428 (code=exited, status=1/FAILURE)
ное 29 11:28:36 miranda systemd[1]: Starting Set console font and keymap...
ное 29 11:28:36 miranda console-setup.sh[428]: /bin/setupcon: 866:
/bin/setupcon: cannot open /tmp/tmpkbd.xTd9cX: No such file
ное 29 11:28:36 miranda systemd[1]: console-setup.service: Main process
exited, code=exited, status=1/FAILURE
ное 29 11:28:36 miranda systemd[1]: Failed to start Set console font and
keymap.
ное 29 11:28:36 miranda systemd[1]: console-setup.service: Unit entered
failed state.
ное 29 11:28:36 miranda systemd[1]: console-setup.service: Failed with
result 'exit-code'.
Around line 866 is the following code that fails "gzip -9n <$TMPFILE":
if [ "$savekbdfile" ]; then
case "$kernel" in
linux)
tempfile || { echo setupcon: Can not create temporary file
>&2; exit 1; }
{
$installdir/bin/ckbcomp -backspace "$backspace"
$acm_option \
$rules_option -model "$XKBMODEL" \
"$XKBLAYOUT" "$XKBVARIANT" "$XKBOPTIONS" >$TMPFILE \
&& gzip -9n <$TMPFILE >"$savekbdfile"
} || exit 1
;;
freebsd)
$installdir/bin/ckbcomp -freebsd -backspace "$backspace" \
$acm_option $rules_option -model "$XKBMODEL" \
"$XKBLAYOUT" "$XKBVARIANT" "$XKBOPTIONS" >"$savekbdfile" \
|| exit 1
;;
esac
fi
I didn't try to investigate further.
Just starting the service later works but on boot it always fails.
Best regards,
Ognyan
I confirm the same error on boot. Not sure what the implications are, the system seems to work, even when I go to the console. Cheers,
I can confirm the same bug on Debian unstable, console-setup 1.164: Apr 27 11:33:08 debian-pc systemd[1]: Starting Set console font and keymap... Apr 27 11:33:08 debian-pc console-setup.sh[537]: /bin/setupcon: 866: /bin/setupcon: cannot open /tmp/tmpkbd.voFOYG: No such file Apr 27 11:33:08 debian-pc systemd[1]: console-setup.service: Main process exited, code=exited, status=1/FAILURE Apr 27 11:33:08 debian-pc systemd[1]: Failed to start Set console font and keymap. Apr 27 11:33:08 debian-pc systemd[1]: console-setup.service: Unit entered failed state. Apr 27 11:33:08 debian-pc systemd[1]: console-setup.service: Failed with result 'exit-code'.
found 846256 1.160 thanks Confirming on current package in testing Adding /tmp in RequiresMountsFor in the unit doesn't seem to fix the problem (tested with a dropin).
Hi, We also encountered the bug, and to me, it seems to be caused by the systemd-tmpfiles-setup.service, shown as "Create Volatile Files and Directories". This is because /tmp is listed as "D" in /usr/lib/tmpfiles.d/tmp.conf, which means its contents gets removed when /bin/systemd-tmpfiles --remove is called, and the service files does exactly that. You might see it in your journal that the bug only happens if console-setup is started before systemd-tmpfiles-setup. I think not having "DefaultDependencies=no" in setup-console's unit file or explicitly having systemd-tmpfiles-setup in After would solve the problem. Also, isn't Bug#818065 a duplicate of this? Regards, Alex Badics
Since I do not know well systemd, I will prefer if some other developer looks into this. The script /bin/setupcon does not require the existence of /tmp because it can use alternative directories if necessary (look at the function tempfile in setupcon). However it will use /tmp if it exists. Therefore, the following perhaps can explain the bug: 1. The scripts of console-setup are started before systemd-tmpfiles-setup. 2. If they finish in time, this is ok. Suppose however that systemd-tmpfiles-setup starts before the scripts of console-setup finish their work. (Is this possible?) 3. Then, ofcourse, if systemd-tmpfiles-setup deletes files that the scripts of console-setup have creaded and expected to be deleted by them and not by some third party, these scripts will fail to work properly. It wourld be preferable if there were a directive to tell systemd not to run systemd-tmpfiles-setup during the execution of console-setup. But ofcourse, if this is impossible, then removing DefaultDependencies=no is (maybe) also a solution. I doubt this can explain #818065. If the system uses systemd, then after `setupcon --save' has been run, the script setupcon is no longer required in order to setup the system. And the other scripts are short and simple and do not require temporary files. On the other hand, it seems likely to me that this bug is a duplicate of #819288. Anton Zinoviev
Yes. We have seen this happen. Although it being a race condition, it's hard to reproduce, and we've only seen it happen on at least 8 core servers. Putting systemd-tmpfiles-setup in the "After" stanza of the console-setup unit file would fix the bug. At least since we've done this on our internal fork, we haven't seen the bug. Regards, Alex Badics
severity #846256 important thanks I have this issue every time I boot my sid system, and: # /etc/systemd/system/console-setup.service.d/override.conf [Unit] After=systemd-tmpfiles-setup.service solved this for me as well. A similiar override.conf is recommended for keyboard-setup.service. Before this fix is put in Debian's package, "DefaultDependencies=no" should be overthought as well. I am raising the severity of this bug to "important". Greetings Marc
severity #846256 important thanks I have this issue every time I boot my sid system, and: # /etc/systemd/system/console-setup.service.d/override.conf [Unit] After=systemd-tmpfiles-setup.service solved this for me as well. A similiar override.conf is recommended for keyboard-setup.service. Before this fix is put in Debian's package, "DefaultDependencies=no" should be overthought as well. I am raising the severity of this bug to "important". Greetings Marc
I also experience this bug. I got in touch with the debian maintainers for systemd at: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=904079 According to the maintainer, the issue should be solved by using the `After=` directive in the unit file for console-setup. Regards, Arnaud
see https://bugs.launchpad.net/ubuntu/+source/console-setup/+bug/1824227
Headquarters Germany: NCP engineering GmbH • Dombuehler Str. 2 • 90449 • Nuremberg North American HQ: NCP engineering Inc. • 601 Cleveland Str., Suite 501-25 • Clearwater, FL 33755 Authorized representatives: Peter Soell, Patrick Oliver Graf, Beate Dietrich Registry Court: Lower District Court of Nuremberg Commercial register No.: HRB 7786 Nuremberg, VAT identification No.: DE 133557619 This e-mail message including any attachments is for the sole use of the intended recipient(s) and may contain privileged or confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please immediately contact the sender by reply e-mail and delete the original message and destroy all copies thereof. We’re also facing that issue here. It’s not 100 % reproducible, but after installing a custom-built Debian image (with debootstrap), it mostly happens after the first boot in vmware. Adding the dependency Marc Haber suggested, seems to fix the issue. Regards, Bernhard
Just a +1 to being affected by this bug, Debian Bullseye (console-setup package version 1.205) on a Dell XPS laptop (4-core i7). I've applied Marc's workaround: # /etc/systemd/system/console-setup.service.d/override.conf [Unit] After=systemd-tmpfiles-setup.service and # /etc/systemd/system/keyboard-setup.serviceoverride.conf [Unit] After=systemd-tmpfiles-setup.service (I've not seen it with keyboard-setup, only console-setup, but applied both based on Marc's recommendation in his post.)
Side note for anybody coming here... On Ubuntu, with snapd, the keyboard-setup.serviceoverride.conf create a loop in dependencies. $ systemd-analyze verify default.target local-fs.target: Found ordering cycle on snap-chromium-2623.mount/start local-fs.target: Found dependency on local-fs-pre.target/start local-fs.target: Found dependency on keyboard-setup.service/start local-fs.target: Found dependency on systemd-tmpfiles-setup.service/start local-fs.target: Found dependency on local-fs.target/start local-fs.target: Job snap-chromium-2623.mount/start deleted to break ordering cycle starting with local-fs.target/start local-fs.target: Found ordering cycle on local-fs-pre.target/start local-fs.target: Found dependency on keyboard-setup.service/start local-fs.target: Found dependency on systemd-tmpfiles-setup.service/start local-fs.target: Found dependency on local-fs.target/start local-fs.target: Job local-fs-pre.target/start deleted to break ordering cycle starting with local-fs.target/start For info only since this is a Debian thread.