SadServers
  • Scenarios
  • Labs
    All Labs Linux & Bash Web Servers Databases Data Processing Docker Kubernetes CI/CD Infrastructure as Code Tooling / Applications
  • Dashboard
  • Solutions
    For Individuals For Businesses
  • Ranking
  • Newsletter
  • Documentation
    FAQ Support Pro Accounts Pro+ Accounts Business Accounts Gift API CLI/TUI Privacy Troubleshooting Interviews
  • Blog
  • Pricing
  • Gift
    Gift Purchase Gift Redeem
  • About
Log In - Sign Up
  1. Labs
  2. systemd
  3. Cheatsheet

Guide

Concepts and learning path

Troubleshooting

Failure modes and fixes

Cheatsheet

Commands to keep handy

systemd cheatsheet

Service control

CommandDescription
systemctl start nginxStart a service now
systemctl stop nginxStop a service
systemctl restart nginxStop then start
systemctl reload nginxReload config (if supported)
systemctl status nginxState, PID, recent log lines
systemctl enable nginxStart at boot
systemctl disable nginxDo not start at boot
systemctl is-active nginxPrint active/inactive (scripts)
systemctl is-enabled nginxPrint enabled/disabled

Listing units

CommandDescription
systemctl list-units --type=serviceLoaded services
systemctl --failedAll failed units (triage)
systemctl list-units --state=failedSame, explicit filter
systemctl reset-failedClear failed state after fix
systemctl list-unit-filesAll installed unit files
systemctl list-timers --allActive and inactive timers
systemctl show nginxAll properties of a unit

Journal logs

CommandDescription
journalctl -u nginxLogs for a unit
journalctl -u nginx -fFollow unit logs
journalctl -u nginx --since todayLogs since midnight
journalctl -bLogs from current boot
journalctl -p err -bError-level messages this boot
journalctl --disk-usageJournal space used

Unit file management

CommandDescription
systemctl cat nginxShow effective unit file
systemctl edit nginxCreate drop-in override
systemctl daemon-reloadReload unit files after changes
systemd-analyze verify my.serviceValidate unit syntax

Boot analysis

CommandDescription
systemd-analyzeTotal boot time
systemd-analyze blameTime per unit at boot
systemctl get-defaultCurrent default target
systemctl isolate rescue.targetSwitch to rescue target

Minimal service unit example

# /etc/systemd/system/myapp.service [Unit] Description=My Application After=network.target [Service] Type=simple User=deploy ExecStart=/opt/myapp/bin/server Restart=on-failure RestartSec=5 [Install] WantedBy=multi-user.target

Pro tips

  • Always run systemctl daemon-reload after editing unit files
  • systemctl status shows the last few log lines — use journalctl -u for full history
  • enable does not start; start does not enable — set both for production
  • Use systemctl edit instead of editing files under /usr/lib/systemd/

Practice scenarios

Hands-on systemd scenarios on live Linux VMs: systemd

SadServersSadServers

Real-world Linux and DevOps scenarios for hands-on learning and technical assessment.

Uptime Robot ratio (30 days)
Product
  • Scenarios
  • For Individuals
  • For Businesses
  • Pricing
Resources
  • FAQ
  • Blog
  • Newsletter
Company
  • About Us
  • Support
  • Privacy Policy
  • Terms of Service
  • Contact
Connect With Us
info@sadservers.com

Made in Canada 🇨🇦
Updated: 2026-06-13 16:06 UTC – 2d2950a