Skip to content
Ameen Abozaid
Planned lessonJNR-048-L06

Logs and services

  • Lesson 6 of 7
  • Junior
On This Lesson 4 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

read logs and control a service with systemd.

Planned topics

  • tail -f file follows a log live; grep filters it.
  • systemd runs services described by unit files in /etc/systemd/system/.
  • systemctl start|stop|restart|status shop manages a service; enable starts it at boot.
  • journalctl -u shop -f follows that service's logs; add --since "10 min ago".
  • In a unit file, Restart=on-failure and User=shop matter.
Draft outline details

Demonstration

bash
sudo systemctl status shop
journalctl -u shop --since "10 min ago"
tail -f /var/log/shop/app.log

Check your understanding

Which command follows a service's logs?

Show answer

journalctl -u <service> -f.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.