[systemd-devel] How to get systemd boot messages on serial console and screen?

Frank Steiner fsteiner-mail1 at bio.ifi.lmu.de
Fri Apr 17 04:57:24 PDT 2015


Lennart Poettering wrote

> We write the status output to /dev/console, see status_vprintf():
> 
> http://cgit.freedesktop.org/systemd/systemd/tree/src/shared/terminal-util.c#n643
> 
> Usually the kernel will forward what is written to /dev/console to all
> console= terminals listed on the kernel cmdline.
> 
> Check the contents of /sys/class/tty/console/active to see which
> ttys those currently are.

I can see both (tty0 and ttyS4) there, but as far as I understand from
reading the documentation /dev/console is always only connected to the
last-specified console. Thus writing to /dev/console will only print
to one console. See kernel/Documentation/serial-console.txt:

"You can specify multiple console= options on the kernel command line.
 Output will appear on all of them. The last device will be used when
 you open /dev/console. So, for example:

        console=ttyS1,9600 console=tty0

 defines that opening /dev/console will get you the current foreground
 virtual console, and kernel messages will appear on both the VGA
 console and the 2nd serial port (ttyS1 or COM2) at 9600 baud."

That would exactly match what I see, i.e., kernel messages on both
ttys, systemd always only on the last one.

I'm not sure how one can write to all consoles in parallel from user
space, I think in SLES 11 blogd was used for this. It would be nice
if systemd could print to all consoles without helper programs like
plymouth etc.

cu,
Frank


-- 
Dipl.-Inform. Frank Steiner   Web:  http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. Bioinformatik    Mail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17           Phone: +49 89 2180-4049
80333 Muenchen, Germany       Fax:   +49 89 2180-99-4049
* Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *


More information about the systemd-devel mailing list