I have systemd configured to not clear the terminal before calling getty
, and also getty
itself is run with the --noclear
option, so that my boot messages are left displayed when the login prompt from getty
appears at the bottom of the screen.
Well, at least they did until three months ago. Now, what happens is the following. Systemd leaves the boot messages on the screen (as I asked it to) and getty does not clear the screen (as I also instructed it to), but after a few seconds, the screen flickers, the boot messages are gone, and a new login prompt is shown on the top of the screen (actually, the screen flickers some three or four times, as I describe below).
I don't know it this is worth mentioning, but if I don't touch the keyboard, the boot messages get cleared after a few seconds. But if I readily start typing my username as soon as the prompt asks for it, and don't hit enter, there is no clearing.
Respawning
These are some relevant journal lines from during boot:
-- Reboot --
Dec 16 22:46:25 smt-dell systemd[1]: systemd 228 running in system mode. (+PAM -AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
Dec 16 22:46:25 smt-dell systemd[1]: Created slice system-netctlx2dauto.slice.
Dec 16 22:46:25 smt-dell systemd[1]: Created slice system-getty.slice.
Dec 16 22:46:33 smt-dell systemd[1]: Starting Login Service...
Dec 16 22:46:33 smt-dell systemd[1]: Starting Automatic wireless network connection using netctl profiles...
-- Subject: Unit netctl-auto@wlp3s0.service has begun start-up
Dec 16 22:46:34 smt-dell systemd[1]: Started Getty on tty1.
Dec 16 22:46:34 smt-dell systemd-logind[327]: New seat seat0.
Dec 16 22:46:34 smt-dell systemd[1]: Reached target Login Prompts.
Dec 16 22:46:34 smt-dell systemd[1]: Started Login Service.
Dec 16 22:46:35 smt-dell systemd[1]: Started Automatic wireless network connection using netctl profiles.
Dec 16 22:46:35 smt-dell wpa_actiond[391]: Starting wpa_actiond session for interface 'wlp3s0'
Dec 16 22:46:35 smt-dell systemd[1]: Reached target Network.
Dec 16 22:46:35 smt-dell systemd[1]: Reached target Multi-User System.
Dec 16 22:46:35 smt-dell systemd[1]: Startup finished in 2.630s (kernel) + 12.170s (userspace) = 46.781s.
Dec 16 22:46:39 smt-dell kernel: wlp3s0: authenticated
Dec 16 22:46:39 smt-dell kernel: wlp3s0: associated
Dec 16 22:46:39 smt-dell wpa_actiond[391]: Interface 'wlp3s0' connected to network 'wl-usb'
There is no log of getty
respawning (as @JdeBP suspected in the comments).
Timestamps of the visual events
I recorded the boot (on camera) and wrote down all the events. I have the \t
, \4
, and \6
escape sequences in /etc/issue
, which show the current time, IPv4 address, and IPv6 address. (These are for the same boot as the journal lines above, so the timestamps should be compared)
- Boot messages are still on the screen. The issue message at the bottom reads:
\t
:22:46:35
\4
: empty\6
: empty
- The boot messages and the first issue message have been cleared, and the second issue message reads:
\t
:22:46:39
\4
:192.168.7.119
\6
: a shortened (::
-syntax) IPv6 address
- The second issue message has been cleaned, and the third reads:
\t
:22:46:41
\4
:192.168.7.119
\6
: a full IPv6 address (all bytes shown explicitly)
- Screen cleared for the last time, and the fourth and last issue message:
\t
:22:46:42
\4
:192.168.7.119
\6
: the same
Netctl
Thanks to a recent bug (in netctl, or wpa_supplicant, or wpa_actiond, I don't know), I discovered that when netctl-auto
is disabled, there is no clearing of the boot messages, nor any re-displaying of the issue message. When I fixed the bug, the boot messages started getting cleared again. When I manually disable netctl-auto
, there is no clearing of the screen, and when I enable it again, the screen gets cleared several times, as explained above.
Question
If it's not clear, my question is: why on Earth would netctl
cause the screen to be cleared and the issue message to be displayed again? And is it possible to disable this behavior?
Relevant links
I have also asked this question on the Arch Linux forums.
systemctl status
of the TTY login service for your virtual terminal. – JdeBP Dec 16 '15 at 07:45--noclear
andTTYVTDisallocate=no
in my unit files (and indeed, systemd does not clear the boot messages right after boot -- there's a delay). – fonini Dec 16 '15 at 11:32getty
is even true in the first place, and demonstrate it to the world. After all, if your system bootstrapped at 09:17, it's false. systemd records what was spawned when. Show that to answerers. – JdeBP Dec 16 '15 at 14:30/dev/vcsa
. you might want to start up a backgroundedcat
of that before your getty and have a look at all of the escapes that are running. you might also want to have a look at what is going on with PAM and loginctl - systemd does a lot of weird, unnecessary stuff a lot of the time, unfortunately. maybe its your video driver? an efi system will switch buffers right around then - from EFI to VGA. – mikeserv Dec 17 '15 at 02:26vcsa
thing (had never heard of it). I substituted-/sbin/agetty --noclear %I $TERM
for a script that runscat /dev/vcsa >/root/cat-dev-vcsa & exec /sbin/agetty "$@"
, but I don't know if that's what you meant. The/root/cat-dev-vcsa
is truncated and really hard to parse, I can't find any clear-terminal sequences in it. Also, when getty is called through this script, it shows the/etc/issue
message, but I can't login (after I type my password, it just shows me the issue message and login prompt again). – fonini Dec 20 '15 at 05:19