Difference between revisions of "Disable clearing of boot messages"

From ArchWiki
Jump to: navigation, search
m (Using flow control: Added note)
(Have boot messages stay on tty1: Nuke /etc/issue stuff)
Line 26: Line 26:
  
 
=== Disable clearing in /etc/issue ===
 
=== Disable clearing in /etc/issue ===
==== Disable displaying of /etc/issue ====
 
  
Edit {{ic|/etc/systemd/system/getty@tty1.service}} (which should no longer be a symlink):
+
If you have an old {{ic|/etc/issue}} that has the "clear TTY" escape sequences, remove them.
  
  ExecStart=-/sbin/agetty --noclear '''--noissue''' %I 38400
+
  # sed -i $'s/\e\[H//; s/\e\[2J//' /etc/issue
 
+
==== Give tty1 a custom /etc/issue ====
+
Copy the existing {{Ic|/etc/issue}} file to {{Ic|/etc/issue.tty1}} (without the first line):
+
sed 1d /etc/issue > /etc/issue.tty1
+
 
+
Add the file to {{ic|/etc/systemd/system/getty@tty1.service}}'s ExecStart line with the {{ic|-f}} switch:
+
 
+
ExecStart=-/sbin/agetty --noclear %I 38400 '''-f /etc/issue.tty1'''
+

Revision as of 13:55, 27 October 2012

Summary help replacing me
Preventing the boot sequence printout from disappearing.
Related
Arch Boot Process

After the boot process, the screen is cleared and the login prompt appears, leaving users unable to read init output and error messages. This default behavior may be modified using methods outlined in this article.

Note that regardless of the chosen option, kernel messages can be displayed for inspection after booting by using dmesg or all logs from the current boot with journalctl -b.

Using flow control

This is basic management that applies to most terminal emulators, including virtual consoles (vc):

Note: This pauses not only the output, but also programs which try to print to the terminal, since they'll block on the write() calls for as long as the output is paused. If your init appears frozen, make sure the system console is not paused.

Have boot messages stay on tty1

By default, arch has the getty@tty1 service enabled. The service file already passes --noclear, which stops agetty from clearing the screen. However systemd clears the screen before starting it because the unit file uses TTYVTDisallocate=yes. To disable this:

# sed /TTYVTDisallocate=/s/yes/no/ < /usr/lib/systemd/system/getty@.service > /etc/systemd/system/getty@tty1.service

Disable clearing in /etc/issue

If you have an old /etc/issue that has the "clear TTY" escape sequences, remove them.

# sed -i $'s/\e\[H//; s/\e\[2J//' /etc/issue