[Bug 1692353] Re: systemd-fsckd : useless CR displayed on console
Zhang Youfu
zhangyoufu at gmail.com
Wed Mar 20 12:54:07 UTC 2019
This bug still exists in 19.04 Disco. Please fix it.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1692353
Title:
systemd-fsckd : useless CR displayed on console
Status in systemd package in Ubuntu:
Triaged
Bug description:
Hello,
My system is "Ubuntu 16.04.2 LTS" (grep DISTRIB_DESCRIPTION /etc/lsb-
release).
The systemd package is installed:
$ dpkg -l | grep systemd
> systemd 229-4ubuntu17
I noticed that approximately 15 seconds after the boot, a useless
Carriage Return ('\r') is displayed on the console (/dev/console).
This character interacts with the display of the user currently logued in
on the console. This screws the current line, when users is pressing keys.
After monitoring system activity, I found the culprit:
/lib/systemd/system/systemd-fsckd.service
To test, run:
service systemd-fsckd stop # In case, it is still running.
service systemd-fsckd start
Go to the console, wait for approximately 15 seconds, and you see the cursor
jumping from its current position to the beginning of the line. This is the BUG.
Note: the console is not the X11 terminal (xterm, lxterminal, etc.) ; the
console is the text tty reached with Control-Alt-F1.
The systemd-fsckd.service starts the following daemon:
/lib/systemd/systemd-fsckd
This is the daemon which displays two useless '\r' characters.
I went to:
http://packages.ubuntu.com/xenial/systemd
I downloaded:
http://archive.ubuntu.com/ubuntu/pool/main/s/systemd/systemd_229-4ubuntu10.debian.tar.xz
The file debian/patches/fsckd-daemon-for-inter-fsckd-communication.patch
contains:
+static int manager_write_console(Manager *m, const char *message) {
[...]
+ if (message) {
+ fprintf(console, "\r%s\r%n", message, &l);
+ if (m->clear < (size_t)l)
+ m->clear = (size_t)l;
+ } else {
+ fputc('\r', console);
+ for (j = 0; j < m->clear; j++)
+ fputc(' ', console);
+ fputc('\r', console);
+ }
So, when no message was previously displayed, "m->clear" is still set
to 0.
Then, when the program ends it calls:
+ /* clear last line */
+ manager_write_console(m, NULL);
However, in the "else" above, two '\r' characters are displayed, surrounding
no space characters.
So, when no message was previously displayed, there is nothing to clear, so
no '\r' character to display.
A trivial patch is attached. It is untested.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1692353/+subscriptions
More information about the foundations-bugs
mailing list