Red Hat Certified System Administrator RHCSA · Free Practice Question Medium
Question 1
Explain the steps required to configure a Red Hat Enterprise Linux 9 system to log all daemon-related messages to a file named 'daemonlog.log' located in the /var/log directory.
Show model answer
In RHEL 9, you need to edit the rsyslog configuration file to achieve this. First, open '/etc/rsyslog.conf' with a text editor as a superuser. Then, add the line 'daemon.* /var/log/daemonlog.log' to this file. This line instructs rsyslog to redirect all messages from the daemon facility to the specified log file. After saving the changes, restart the rsyslog service using 'sudo systemctl restart rsyslog'. This will apply the new configuration and start logging daemon messages to 'daemonlog.log' in '/var/log'.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
