Cheatsheet: Systemd/Systemctl


- PDF Link: cheatsheet-systemd-A4.pdf, Category: linux
- Blog URL: https://cheatsheet.dennyzhang.com/cheatsheet-systemd-A4
- Related posts: CheatSheet: Ubuntu Apt, Cheatsheet: Linux Security, #denny-cheatsheets
1.1 Systemd manage service
Name | Summary |
---|---|
Check service | systemctl status $service_name , systemctl -l status $service_name |
Service cfg file | /lib/systemd/system/ |
1.2 Systemd check log
Name | Summary |
---|---|
Check log of systemd service | journalctl -u docker , journalctl -p err -u docker |
Filter log by a timeslot | journalctl --since 10:00 --until "1 hour ago" -u docker |
View kernel messages | journalctl -k |
Check logs with error level | journalctl -p err -b |
1.3 Systemd Trouble Shooting
Name | Summary |
---|---|
Force machine reboot, if reboot doesn’t work | systemctl --force reboot , systemctl --force --force reboot |