Cette console sera accessible par les touches
[CTRL]+[ALT]+F12
, retour au bureau par [CTRL]+[ALT]+F7 (ou F1)Il faut créer un fichier texte dans le répertoire
/etc/systemd/system/
(sudo nano) /etc/systemd/system/journal@tty12.service
le contenu:
[Unit]
Description=Journal systemd dans %I
Documentation=man:journalctl(1)
After=systemd-user-sessions.service systemd-journald.service
ConditionPathExists=/dev/tty0
[Service]
ExecStart=/usr/bin/sh -c "exec /usr/bin/journalctl -af > /dev/%I"
Type=idle
Restart=always
RestartSec=1
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=no
KillMode=process
IgnoreSIGPIPE=no
# Unset locale for the console getty since the console has problems
# displaying some internationalized messages.
Environment=LANG=fr LANGUAGE=fr LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=
[Install]
Alias=getty.target.wants/journal@tty12.service
Avec ce raccourci clavier, vous pourrez voir en temps réel (1 seconde près) si votre linux ne subit pas trop d'erreurs (en rouge).
Pour le tester :
sudo systemctl start journal@tty12.service
Pour le lancer automatiquement au démarrage
sudo systemctl enable journal@tty12.service
-------------------------
Technique utilisable avec d'autre consoles tty et avec la commande
tail
; par exemple voir les dernières lignes du fichier log de pacman sur tty6 :/etc/systemd/system/journal@tty6.service
...
ExecStart=/usr/bin/sh -c "exec /usr/bin/tail -f /var/log/pacman.log > /dev/%I"
...
[Install]
Alias=getty.target.wants/journal@tty6.service