Files
podman/docs/source/markdown/options/restart.md
Jan Kaluza c12b1b32bc Rewrite the Quadlet documentation.
This commit does the following:

- Splits the podman-systemd.unit.5.md into multiple files - one for each
  quadlet file type, podman-quadlet.7.md for general quadlet information
  and podman-quadlet-basic-usage.7.md for quadlet examples.
- Removes the original podman-systemd.unit.5.md file.
- Adds support for jinja2 templating language in the markdown_preprocess.
- Uses jinja2 in options/*.md to use the single .md file for both podman
  subcommands man-pages and quadlet man-pages. This deduplicates
  the Quadlet man-pages a lot.
- Adds new `@@option quadlet:source.md` preprocess command to import
  such .md files from options directory.

Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
2025-09-02 12:49:45 +02:00

1.2 KiB

####> This option file is used in: ####> podman create, pod clone, pod create, run, update ####> If file is edited, make sure the changes ####> are applicable to all of those.

--restart=policy

Restart policy to follow when containers exit. Restart policy does not take effect if a container is stopped via the podman kill or podman stop commands.

Valid policy values are:

  • no : Do not restart containers on exit
  • never : Synonym for no; do not restart containers on exit
  • 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
  • always : Restart containers when they exit, regardless of status, retrying indefinitely
  • unless-stopped : Identical to always

Podman provides a systemd unit file, podman-restart.service, which restarts containers after a system reboot.

When running containers in systemd services, use the restart functionality provided by systemd. In other words, do not use this option in a container unit, instead set the Restart= systemd directive in the [Service] section. See podman-quadlet(7) and systemd.service(5).