Conversation
Current systemd-vconsole-setup implementation uses try and fail approach while calling setfont. Starting with 1e15af4, it sometimes causes ugly syslog messages: /usr/bin/setfont failed with exit status 71. setfont: ERROR kdfontop.c:183 put_font_kdfontop: Unable to load such font with such kernel version Setting fonts failed with a "system error", ignoring. It seems that systemd upstream already tried to address this problem, but at that time they haven't found a good way. The setfont --quiet is specifically intended for systemd-vconsole-setup, and it will allow to suppress the error in systemd, but keep it in other cases. Reference: https://bugzilla.opensuse.org/show_bug.cgi?id=1212970 Signed-off-by: Stanislav Brabec <[email protected]>
|
If systemd doesn't care whether the font was loaded or not (which is very odd) then why not just redirect setfont stderr to /dev/null ?
But the error did happen. What is the point of quietly ignoring it? Wouldn't it be easier not to run setfont at all in this case? |
| \fB\-R\fR, \fB\-\-reset\fR | ||
| Reset the screen font, size, and Unicode mapping to the bootup defaults. | ||
| .TP | ||
| \fB\-v\fR, \fB\-\-quiet\fR |
There was a problem hiding this comment.
The short option should be -q, not -v.
| .TP | ||
| \fB\-v\fR, \fB\-\-quiet\fR | ||
| If kernel cannot load font, do not log error. This prevents ugly errors | ||
| with systemd try-and-fail detection of a fully initialized console. |
There was a problem hiding this comment.
Can you remove this mention of systemd from the option description? The documentation should describe what the option does, not where the option can be used.
This option decreases the amount of information.
But actually, this utility does not do what is written here. See below.
|
|
||
| struct kfont_context { | ||
| const char *progname; | ||
| int quiet; |
There was a problem hiding this comment.
You don't need a new flag and function to display it. All you need to do is kfont_set_logger(ctx, NULL) to stop displaying all errors.
|
Redirecting stderr to /dev/null would suppress all errors, which is not wanted. It specifically needs to handle this error. systemd does care that the font is not loaded. It just currently have no good way to determine whether the terminal is ready to accept setfont. That it why it blindly calls it, and if it fails, then it tries again later. It worked perfectly until 1e15af4, when you found an improperly handled error in setfont. Now it still works perfectly, but it sometimes reports this error into the syslog. System works well, but people complain that the syslog contains error. systemd people tried to address it, but they did not found a better way (see https://bugzilla.opensuse.org/show_bug.cgi?id=1212970#c4 and systemd/systemd@93c9a9d). Maybe a dedicated return code would help even more. I'll ask. When I get a reply, I will update the patch. |
This contradicts what is written in your PR:
Then they should be interested in this error too. Because this error describes a real problem. This error is no different from other errors.
I did not participate in the discussion.
No, it's not. What you're doing now is brute force. syslog highlights the fallacy of this approach. But instead of solving the problem, you just want to hide it.
No need to update this PR. You're solving the wrong problem. You need to not hide the problem, but create a way/tool to understand whether the console is initialized or not. This could be a separate function in libkfont, or a check in setfont, or a separate utility. I think I know how to do that. I just need to reproduce your problem locally to test the solution. |
|
Done. I added the |
Current systemd-vconsole-setup implementation uses try and fail approach while calling setfont. Starting with 1e15af4, it sometimes causes ugly syslog messages:
/usr/bin/setfont failed with exit status 71.
setfont: ERROR kdfontop.c:183 put_font_kdfontop: Unable to load such font with such kernel version Setting fonts failed with a "system error", ignoring.
It seems that systemd upstream already tried to address this problem, but at that time they haven't found a good way.
The setfont --quiet is specifically intended for systemd-vconsole-setup, and it will allow to suppress the error in systemd, but keep it in other cases.
Reference: https://bugzilla.opensuse.org/show_bug.cgi?id=1212970