https://wiki.archlinux.org/api.php?action=feedcontributions&user=Adriaticc&feedformat=atomArchWiki - User contributions [en]2024-03-28T16:29:17ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Disable_clearing_of_boot_messages&diff=110812Disable clearing of boot messages2010-07-05T07:44:40Z<p>Adriaticc: /* More permanent solution */</p>
<hr />
<div>[[Category:Boot process (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Preventing the boot sequence printout from dissapearing.}}<br />
{{Article summary heading|Language}}<br />
{{i18n_entry|English|Disable clearing of boot messages}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Arch Boot Process}}<br />
{{Article summary end}}<br />
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.<br />
<br />
Note that regardless of the chosen option, kernel messages can be displayed for inspection after booting by using {{codeline|dmesg}}.<br />
<br />
==Using flow control==<br />
This is basic management that applies to most terminal emulators, including virtual consoles (vc):<br />
* Press {{codeline|Ctrl+S}} to pause the output<br />
* And {{codeline|Ctrl+Q}} to resume it<br />
<br />
==More permanent solution==<br />
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:<br />
<br />
* Wait for a keypress before clearing the screen:<br />
read -n1<br />
* Wait for at most 5 seconds or until a keypress occurs:<br />
read -t5 -n1<br />
<br />
Add one of these to either the bottom of {{Filename|/etc/rc.local}} to pause when booting is finished, or the stat_fail() function in {{Filename|/etc/rc.d/functions}} to pause when a boot script in {{{Filename|/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're unsure what this means, use {{Filename|/etc/rc.local}}.<br />
<br />
==Have boot messages stay on tty1==<br />
<br />
'''Normal behaviour:'''<br />
Boot messages shoot past, screen is cleared, contents of '''/etc/issue''' are displayed, login (either CLI or login manager) is displayed.<br />
<br />
'''Desired behaviour:'''<br />
Boot messages shoot past, login (either CLI or login manager) is displayed without clearing of tty1<br />
<br />
If the default agetty, i.e. default arch, is used, it is possible to skip displaying the contents of '''/etc/issue''' altogether and instead keep the boot messages displayed on tty1. In '''/etc/inittab''', add the {{Codeline|"-i"}} option for the first virtual console:<br />
c1:2345:respawn:/sbin/agetty '''-i''' -8 38400 tty1 linux<br />
c2:2345:respawn:/sbin/agetty -8 38400 tty2 linux<br />
.<br />
.<br />
.<br />
<br />
Alternatively simply comment the first line. '''Note:''' this way the login dialogue doesn't appear, i.e. tty1 is locked.<br />
<br />
#c1:2345:respawn:/sbin/agetty -8 38400 tty1 linux <br />
c2:2345:respawn:/sbin/agetty -8 38400 tty2 linux <br />
.<br />
.<br />
.<br />
<br />
===Restoring /etc/issue===<br />
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]]:<br />
<pre><br />
ESC (exit insert mode)<br />
:r !clear<br />
:x (Save and Exit)<br />
</pre><br />
This will insert the literal characters equivalent to the shell {{codeline|clear}} command. Optionally you can also insert the characters manually: <br />
<pre><br />
i (insert)<br />
ctrl-v (insert literal character)<br />
ESC (insert escape character)<br />
c<br />
ESC (exit insert mode)<br />
ZZ (Save and Exit)<br />
</pre><br />
<br />
In [[Emacs]]:<br />
C-q ESC (to insert literal escape)<br />
<br />
<!-- The tip is kind of unrelated to the article --><br />
{{tip|to just clear the screen after logging out on a virtual terminal, do: {{codeline|echo -e "clear\nreset" >> ~/.bash_logout}}}}</div>Adriaticchttps://wiki.archlinux.org/index.php?title=Disable_clearing_of_boot_messages&diff=110811Disable clearing of boot messages2010-07-05T07:43:07Z<p>Adriaticc: Suggest pause in stat_fail() of /etc/rc.d/functions</p>
<hr />
<div>[[Category:Boot process (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Preventing the boot sequence printout from dissapearing.}}<br />
{{Article summary heading|Language}}<br />
{{i18n_entry|English|Disable clearing of boot messages}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Arch Boot Process}}<br />
{{Article summary end}}<br />
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.<br />
<br />
Note that regardless of the chosen option, kernel messages can be displayed for inspection after booting by using {{codeline|dmesg}}.<br />
<br />
==Using flow control==<br />
This is basic management that applies to most terminal emulators, including virtual consoles (vc):<br />
* Press {{codeline|Ctrl+S}} to pause the output<br />
* And {{codeline|Ctrl+Q}} to resume it<br />
<br />
==More permanent solution==<br />
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:<br />
<br />
* Wait for a keypress before clearing the screen:<br />
read -n1<br />
* Wait for at most 5 seconds or until a keypress occurs:<br />
read -t5 -n1<br />
<br />
These commands can be added to the bottom of {{Filename|/etc/rc.local}} to pause when booting is finished, or the stat_fail() function in {{Filename|/etc/rc.d/functions}} to pause when a boot script in {{{Filename|/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're unsure what this means, use {{Filename|/etc/rc.local}}.<br />
<br />
==Have boot messages stay on tty1==<br />
<br />
'''Normal behaviour:'''<br />
Boot messages shoot past, screen is cleared, contents of '''/etc/issue''' are displayed, login (either CLI or login manager) is displayed.<br />
<br />
'''Desired behaviour:'''<br />
Boot messages shoot past, login (either CLI or login manager) is displayed without clearing of tty1<br />
<br />
If the default agetty, i.e. default arch, is used, it is possible to skip displaying the contents of '''/etc/issue''' altogether and instead keep the boot messages displayed on tty1. In '''/etc/inittab''', add the {{Codeline|"-i"}} option for the first virtual console:<br />
c1:2345:respawn:/sbin/agetty '''-i''' -8 38400 tty1 linux<br />
c2:2345:respawn:/sbin/agetty -8 38400 tty2 linux<br />
.<br />
.<br />
.<br />
<br />
Alternatively simply comment the first line. '''Note:''' this way the login dialogue doesn't appear, i.e. tty1 is locked.<br />
<br />
#c1:2345:respawn:/sbin/agetty -8 38400 tty1 linux <br />
c2:2345:respawn:/sbin/agetty -8 38400 tty2 linux <br />
.<br />
.<br />
.<br />
<br />
===Restoring /etc/issue===<br />
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]]:<br />
<pre><br />
ESC (exit insert mode)<br />
:r !clear<br />
:x (Save and Exit)<br />
</pre><br />
This will insert the literal characters equivalent to the shell {{codeline|clear}} command. Optionally you can also insert the characters manually: <br />
<pre><br />
i (insert)<br />
ctrl-v (insert literal character)<br />
ESC (insert escape character)<br />
c<br />
ESC (exit insert mode)<br />
ZZ (Save and Exit)<br />
</pre><br />
<br />
In [[Emacs]]:<br />
C-q ESC (to insert literal escape)<br />
<br />
<!-- The tip is kind of unrelated to the article --><br />
{{tip|to just clear the screen after logging out on a virtual terminal, do: {{codeline|echo -e "clear\nreset" >> ~/.bash_logout}}}}</div>Adriaticc