Restart=
The systemd service setting that decides when systemd restarts a process that exits, such as on-failure or always.
In more detail
Restart=on-failure restarts after a crash or non-zero exit but not after a clean stop, and RestartSec= sets the delay. systemd also limits how many restarts may happen in a short period, so a crashing service ends up failed instead of looping forever. The journal shows each restart and the exit status that caused it.
Related terms
- systemd service — A systemd unit that describes a long-running or one-shot process: what command to run, as which user and what to do when it exits.
- process supervisor — A program that starts processes, watches them and restarts them if they exit, such as systemd or a container platform.
- exit code — A number a process returns when it finishes: 0 means success, anything else means something went wrong.
- journald — The systemd logging service that collects messages from the kernel, services and programs into a structured, indexed journal.
Taught in
- Your Own Unit, And Reading journald — Linux Fundamentals & Systems Administration