cancel
Showing results for 
Search instead for 
Did you mean: 
TudorRaduta
Community Manager
Community Manager
  • 151 Views

Why Did My Service Fail?

Wednesday Challenge: The Log Detective

Happy Wednesday, everyone!

Time for another hands-on challenge. This is a scenario you will face constantly as a sysadmin and is a core part of the RHCSA exam: "Locate and interpret system log files and journals."

Your job isn't just to run commands; it's to find answers. Let's get to it!

The Scenario:

You've just configured the Apache web server, but when you try to start it, you get an error. The command systemctl start httpd.service fails.

Running systemctl status httpd.service just tells you it "Failed" but doesn't show the real reason (like a typo in a config file). The system journal is full of thousands of messages from other services. You need to find the exact error message that caused the failure.

Your Challenge:

Post the commands you would use to find the needle in the haystack!

  1. What is the first journalctl command you would run to see only the logs for the httpd.service unit?
  2. The output from step 1 is still too long (it shows logs from last week). What flag would you add to your command to see only the logs from the last 10 minutes?
  3. How would you change the command to show the most recent logs first and limit the output to just 25 lines?
  • Bonus Question: What command would you run to follow the logs in real-time while you try to start the service again?

Let's see those `journalctl` commands!

1 Reply
Blue_bird
Starfighter Starfighter
Starfighter
  • 129 Views

1) journalctl -u httpd.service

2) journalctl -u httpd.service --since "10 minutes ago"

3) journalctl -u httpd.service -r -n 25

To follow the logs in real-time for httpd.service while we try to start it again:

 journalctl -u httpd.service -f

Thanks

0 Kudos
Join the discussion
You must log in to join this conversation.