RHCSA Rapid Track
In this exercise, you will configure the system journal to preserve its data after a reboot.
Outcomes
You should be able to configure the system journal to preserve its data after a reboot.
Log in to workstation as student using student as the password.
On workstation, run lab log-preserve start to start the exercise.
This script ensures that the environment is set up correctly.
[student@workstation ~]$lab log-preserve start
From
workstation, open an SSH session toserveraasstudent.[student@workstation ~]$ssh student@servera...output omitted...[student@servera ~]$As the superuser, confirm that the
/var/log/journaldirectory does not exist. Use the ls command to list the/var/log/journaldirectory contents. Use sudo to elevate thestudentuser privileges. Usestudentas the password if asked.[student@servera ~]$sudo ls /var/log/journal[sudo] password for student:studentls: cannot access '/var/log/journal': No such file or directoryAs the
/var/log/journaldirectory does not exist, thesystemd-journaldservice is not preserving its log data.Configure the
systemd-journaldservice onserverato preserve journals across a reboot.Uncomment the
Storage=autoline in the/etc/systemd/journald.conffile and setStoragetopersistent. You may use the sudo vim /etc/systemd/journald.conf command to edit the configuration file. Type/ Storage=autofrom vim command mode to search for theStorage=autoline....output omitted... [Journal] Storage=persistent ...output omitted...
Use the systemctl command to restart the
systemd-journaldservice to bring the configuration changes into effect.[student@servera ~]$sudo systemctl restart systemd-journald.service
Confirm that the
systemd-journaldservice onserverapreserves its journals such that the journals persist across reboots.Use the systemctl reboot command to restart
servera.[student@servera ~]$sudo systemctl rebootConnection to servera closed by remote host. Connection to servera closed.[student@workstation ~]$Notice that the SSH connection was terminated as soon as you restarted the
serverasystem.Open an SSH session to
serveraagain.[student@workstation ~]$ssh student@servera...output omitted...[student@servera ~]$Use the ls command to confirm that the
/var/log/journaldirectory exists. The/var/log/journaldirectory contains a subdirectory with a long hexadecimal name. The journal files are found in that directory. The subdirectory name on your system will be different.[student@servera ~]$sudo ls /var/log/journal[sudo] password for student:student73ab164e278e48be9bf80e80714a8cd5[student@servera ~]$sudo ls \/var/log/journal/system.journal user-1000.journal73ab164e278e48be9bf80e80714a8cd5Log out of
servera.[student@servera ~]$exitlogout Connection to servera closed.