Preserve System Journals

Red Hat Enterprise LinuxBeginner
Practice Now

Introduction

As a system administrator, managing system logs is a fundamental responsibility. The systemd journal provides a centralized and structured logging solution. In this challenge, you will practice essential skills for maintaining system journals on a Red Hat Enterprise Linux system. You will learn how to configure journal persistence, set size limits to prevent excessive disk usage, and manually rotate log files. These are key competencies for system maintenance and are relevant for the RHCSA exam.

Manage the Systemd Journal

In this challenge, you will learn how to manage and maintain system journals on a running Linux system, a key skill required for the RHCSA exam.

Tasks

  • Task 1: Explore the current system journal using the journalctl command.
  • Task 2: Configure the system journal to limit its maximum disk usage to 100M.
  • Task 3: Manually trigger a journal rotation and apply the new size limit.

Requirements

  • Perform all operations as the labex user with sudo privileges.
  • The default working directory is /home/labex.
  • Modify the system journal configuration file at /etc/systemd/journald.conf.
  • Set the SystemMaxUse parameter to 100M.
  • Use the journalctl command to rotate the journal and enforce the size limit.

Example

After completing the tasks, checking the journal's disk usage should show that it does not exceed the configured limit. The exact size will vary, but it should be under 100M.

$ sudo du -sh /var/log/journal/
XXM /var/log/journal/

Summary

In this challenge, you have learned how to manage the systemd journal on a Red Hat Enterprise Linux system. You practiced viewing logs with journalctl, configuring persistent storage limits in /etc/systemd/journald.conf, and manually rotating and cleaning journal files. These skills are essential for maintaining system health and are a key part of the RHCSA skill set.

✨ Check Solution and Practice