github.com/containers/podman/v5@v5.1.0-rc1/docs/source/markdown/options/restart.md (about) 1 ####> This option file is used in: 2 ####> podman create, pod clone, pod create, run, update 3 ####> If file is edited, make sure the changes 4 ####> are applicable to all of those. 5 #### **--restart**=*policy* 6 7 Restart policy to follow when containers exit. 8 Restart policy does not take effect if a container is stopped via the **podman kill** or **podman stop** commands. 9 10 Valid _policy_ values are: 11 12 - `no` : Do not restart containers on exit 13 - `never` : Synonym for **no**; do not restart containers on exit 14 - `on-failure[:max_retries]` : Restart containers when they exit with a non-zero exit code, retrying indefinitely or until the optional *max_retries* count is hit 15 - `always` : Restart containers when they exit, regardless of status, retrying indefinitely 16 - `unless-stopped` : Identical to **always** 17 18 Podman provides a systemd unit file, podman-restart.service, which restarts containers after a system reboot. 19 20 When running containers in systemd services, use the restart functionality provided by systemd. 21 In other words, do not use this option in a container unit, instead set the `Restart=` systemd directive in the `[Service]` section. 22 See **podman-systemd.unit**(5) and **systemd.service**(5).