Disable clearing of boot messages

From ArchWiki
Revision as of 06:48, 26 September 2011 by Beroal (Talk | contribs)

Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Template:Article summary start

Template:Article summary text 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.

Note: Given the recent change in agetty, the mandatory change is: add a Template:Codeline option to the call of agetty in Template:Filename and also remove Template:Filename first line. See below

Using flow control

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

More permanent solution

For a more permanent change, the following can be used to add a pause or wait for keypress while boot messages are still on the screen:

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

Add one of these to either the bottom of Template:Filename to pause when booting is finished, or the stat_fail() function in Template:Filename to pause when a boot script in /etc/rc.d fails with an explicit error code. Note that the latter is a system script and may be overwritten when that file is updated. If you are unsure what this means, use Template:Filename.

Have boot messages stay on tty1

Normal behaviour: Boot messages shoot past, screen is cleared, contents of Template:Filename are displayed, login (either CLI or login manager) is displayed.

Desired behaviour: Boot messages shoot past, login (either CLI or login manager) is displayed without clearing of tty1.

First you should know that screen may be cleared:

I.e. to force desired behavior you should eliminate one/all of the above factors.

Disable clearing by getty

In Template:Filename, you will find a list of numbered consoles which look something like the following; just scroll down in the file to find it. If you are using agetty or mingetty as getty, add the Template:Codeline option for the first virtual console (the c1 line) only:

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

Disable clearing in /etc/issue

Disable displaying of /etc/issue

Add the Template:Codeline option in Template:Filename:

c1:2345:respawn:/sbin/agetty --noissue -8 38400 tty1 linux

Alternatively simply comment the above line. Note: this way the login dialogue does not appear, i.e. tty1 is locked.

Give tty1 a custom /etc/issue

Copy the existing Template:Filename file to Template:Filename (without the first line):

sed 1d /etc/issue > /etc/issue.tty1

Find this in Template:Filename:

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

Replace it with:

c1:2345:respawn:/sbin/agetty -8 38400 tty1 linux -f /etc/issue.tty1

Edit /etc/issue directly

Simply cut the contents of the first line in Template:Filename so it looks like this:

Arch Linux \r  (\n) (\l)
Warning: Read below how to restore the file before attempting this.
Restoring /etc/issue

The characters cannot be just typed again into the file because they are special characters not available on your keyboard!

After you cut the contents from line 1 in Template:Filename, paste it into a temporary file somewhere on you computer so you can copy and paste it back into Template:Filename later when you wish to restore original functionality. You can also backup the whole Template:Filename somewhere safe and restore it when needed.

Optionally, if you are more advanced, you can follow special procedures for typing in these special characters:

Methods of placing literal escape characters are editor dependent. In Vim:

ESC (exit insert mode)
:r !clear
:x (Save and Exit)

This will insert the literal characters equivalent to the shell Template:Codeline command. Optionally you can also insert the characters manually:

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

In Emacs:

C-q ESC (to insert literal escape)

See Also