Disable clearing of boot messages

From ArchWiki
Revision as of 21:47, 2 March 2010 by Tomato (Talk | contribs) (Restoring /etc/issue: added full reset of terminal on logout)

Jump to: navigation, search

Template:Article summary start Template:Article summary text Template:Article summary heading Template:I18n entry Template:Article summary heading Template:Article summary wiki Template:Article summary end 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 Template:Codeline.

Using flow control

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

Flexible /etc/rc.local solution

For a more permanent change, add one of the following to the bottom of Template:Filename:

  • Wait for a keypress before clearing the screen:
 read -n1
  • Wait for at most 5 seconds or until a keypress occurs:
 read -t5 -n1

Delete the first escape code of /etc/issue

The offending escape code: Template:Codeline. Consider that in addition to not clearing the screen after booting, this will stop the screen from being cleared after logging out from regular sessions.

In some cases the whole first line will need to be deleted, as there is more than one instructions, i.e. one clears the screen and the other one places the cursor at the top.

If using the default agetty, it is possible to skip displaying /etc/issue altogether. In /etc/inittab, add the Template:Codeline option for the first virtual console:

c1:2345:respawn:/sbin/agetty -i -8 38400 tty1 linux
c2:2345:respawn:/sbin/agetty -8 38400 tty2 linux

Restoring /etc/issue

The characters can't be just typed again into the file; the literal escape character needs to be placed and the way of doing so is editor dependent. In Vim:

i (insert)
ctrl-v (insert literal character)
ESC (insert escape character)
ESC (exit insert mode)
ZZ (Save and Exit)

In Emacs:

C-q ESC (to insert literal escape)
Tip: to just clear the screen after logging out on a virtual terminal, do: Template:Codeline