Skip to content

Instantly share code, notes, and snippets.

Forked from pydevops/
Created December 25, 2022 18:48
Show Gist options
  • Save jriguera/185b5c78d205f44236e99f5ad8cc76ec to your computer and use it in GitHub Desktop.
Save jriguera/185b5c78d205f44236e99f5ad8cc76ec to your computer and use it in GitHub Desktop.
systemd systemctl journalctl cheatsheet


show service unit file

systemctl cat <service>
systemctl list-units -t service
systemctl status chef-client

edit service unit

systemctl edit  --full google-ip-forwarding-daemon.service


journalctl -u google-accounts-daemon.service

check which services for google

systemd-analyze blame: show a list of service has been loaded

#check its log
journalctl -u google-startup-scripts.service
systemctl list-units --all --state=inactive | grep google
  google-instance-setup.service        loaded    inactive dead Google Compute Engine Instance Setup
  google-network-setup.service         loaded    inactive dead Google Compute Engine Network Setup
  google-startup-scripts.service       loaded    inactive dead Google Compute Engine Startup Scripts
systemctl list-unit-files | grep google
google-accounts-daemon.service         enabled
google-clock-skew-daemon.service       enabled
google-instance-setup.service          enabled
google-ip-forwarding-daemon.service    enabled
google-network-setup.service           enabled
google-shutdown-scripts.service        enabled
google-startup-scripts.service         enabled

systemd preset



enable google-accounts-daemon.service
enable google-clock-skew-daemon.service
enable google-instance-setup.service
enable google-ip-forwarding-daemon.service
enable google-network-setup.service
enable google-shutdown-scripts.service
enable google-startup-scripts.service


journalctl -u kubelet
journalctl -u kubelet -f
journalctl -u kubelet --since today
systemctl status google-accounts-daemon.service
journalctl -u google-accounts-daemon.service -f
systemctl list-timers
NEXT                         LEFT       LAST                         PASSED       UNIT                         ACTIVATES
Tue 2018-01-16 23:20:46 UTC  19min left Mon 2018-01-15 23:20:46 UTC  23h ago      systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Tue 2018-01-16 23:55:36 UTC  54min left Tue 2018-01-16 22:55:36 UTC  5min ago     crash-sender.timer           crash-sender.service
Wed 2018-01-17 00:00:00 UTC  58min left Tue 2018-01-16 23:00:06 UTC  1min 13s ago kube-logrotate.timer         kube-logrotate.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment