Working with System Service Log Files Using the Journal Control

Hands-On Lab

 

Photo of Terrence Cox

Terrence Cox

Senior Vice President of Content

Length

00:30:00

Difficulty

Beginner

Troubleshooting is an important part of working with services through systemd. In this hands-on lab, we will learn how to view system service log files using the Journal Control utility. At the end of this hands-on lab, you will know how to use the built-in journalctl utility to view and troubleshoot system services.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Working with System Service Log Files Using the Journal Control

Introduction

Troubleshooting is an important part of working with services through systemd. In this hands-on lab, we will learn how to view system service log files using the Journal Control utility. At the end of this hands-on lab, you will know how to use the built-in journalctl utility to view and troubleshoot system services.

Connecting to the Lab

  1. Open your terminal application, and run the following command. (Remember to replace <PUBLIC_IP> with the public IP you were provided on the lab instructions page.)
    ssh cloud_user@<PUBLIC_IP>
  2. Enter your password at the prompt.

Check the Web Server Configuration File

  1. Change to the root account.
    sudo su -
  2. Check the status of the web service.
    systemctl status httpd.service
  3. Attempt to start the web service.
    systemctl start httpd.service
  4. After the service fails to start, check the journal.
    journalctl -u httpd.service
  5. Check the directory where the httpd configuration file should be.
    ls /etc/httpd/conf
  6. Restore the original httpd configuration file.
    mv /etc/httpd/conf/httpd.conf.bkup /etc/httpd/conf/httpd.conf
  7. Restart the service.
    systemctl restart httpd.service

Verify That the Web Server Service Is Running

  1. Check the status of the service.
    systemctl status httpd.service
  2. Navigate to the local web page.
    elinks http://localhost

Conclusion

Congratulations, you've successfully completed this hands-on lab!