Logs and services
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 filefollows a log live;grepfilters it.- systemd runs services described by unit files in
/etc/systemd/system/. systemctl start|stop|restart|status shopmanages a service;enablestarts it at boot.journalctl -u shop -ffollows that service's logs; add--since "10 min ago".- In a unit file,
Restart=on-failureandUser=shopmatter.
Draft outline details
Demonstration
sudo systemctl status shop
journalctl -u shop --since "10 min ago"
tail -f /var/log/shop/app.logCheck 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.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.