Courseiva

EX200 Deploy, configure, and maintain systems Practice Question

A system administrator notices that a RHEL 9 server's /var/log/messages is filling up the /var partition. The administrator wants to ensure log rotation runs daily and keeps 4 weeks of logs. Which configuration file should be modified?

⚠ Common exam trap

Candidates often confuse the log rotation configuration file (/etc/logrotate.d/syslog) with the cron job that triggers it (/etc/cron.daily/logrotate) or with the logging daemon configuration files (journald.conf or rsyslog.conf), assuming those control rotation parameters.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

/etc/logrotate.d/syslog

/etc/logrotate.d/syslog is the configuration file that controls log rotation for system log files such as /var/log/messages. By modifying this file, the administrator can set the rotation frequency to daily and specify the number of weeks (e.g., rotate 28 for 4 weeks) to retain logs, directly addressing the requirement.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    /etc/systemd/journald.conf

    Why it's wrong here

    This file contains settings for systemd-journald, a separate logging daemon that manages its own binary journal. It does not control rotation of text-based syslog files like /var/log/messages. Although journald has size and retention limits (e.g., SystemMaxUse), those are not logrotate directives, and this path is not read by logrotate.

  • ✓

    /etc/logrotate.d/syslog

    Why this is correct

    This is a logrotate drop-in configuration file located under /etc/logrotate.d. logrotate reads this file when it runs, and it lists /var/log/messages (along with /var/log/secure, cron, etc.) with directives for rotation frequency, number of retained rotated logs, and a postrotate command to signal rsyslog with HUP. Editing this file is the correct way to change how those syslog files are rotated.

  • ✗

    /etc/rsyslog.conf

    Why it's wrong here

    This is the main configuration file for the rsyslog daemon. It defines input modules, rule sets, and output destinations, such as writing to /var/log/messages. It does not contain rotate, daily, weekly, size, or count directives, and logrotate does not parse this file; therefore changing it will not alter log rotation behavior.

  • ✗

    /etc/cron.daily/logrotate

    Why it's wrong here

    This path is a cron script maintained in the /etc/cron.daily directory that runs the logrotate utility each day. It is the scheduler or trigger that invokes /usr/sbin/logrotate with /etc/logrotate.conf, not a configuration file for individual log files. Any rotation settings for /var/log/messages belong in /etc/logrotate.d, so editing or replacing this script would be the wrong layer.

About these practice questions

Courseiva writes every EX200 question from scratch — 427 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This EX200 practice question is part of Courseiva's free Red Hat certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the EX200 exam.