Show unit file content

Print the full unit file including drop-ins

systemctl cat myapp.service

tool
systemd26 commands
tags
systemddebug

More systemd commands

  • systemd-analyze blame | head -20

    Show top 20 units by initialization time

  • systemd-analyze dot --require | dot -Tsvg > boot.svg && open boot.svg

    Render full boot dependency graph as SVG

  • cat > /etc/systemd/system/myapp.service <<EOF [Unit] Description=My App After=network.target [Service] ExecStart=/usr/bin/myapp Restart=always RestartSec=5 User=appuser [Install] WantedBy=multi-user.target EOF

    Minimal systemd service unit template

  • systemd-run --uid=1000 --gid=1000 --wait /usr/bin/myapp --task

    Run a transient one-shot unit under a specific user

  • cat > /etc/systemd/system/backup.timer <<EOF [Unit] Description=Daily backup [Timer] OnCalendar=daily Persistent=true [Install] WantedBy=timers.target EOF

    Replacement for cron with Persistent=true for missed runs

all 26 systemd commands