summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-05-03 23:14:12 +0200
committerGitHub <noreply@github.com>2019-05-03 23:14:12 +0200
commit4aa90145bf611a7bc08ddff7e061a630154e8b40 (patch)
tree01dc345c05b6ef2c5416eb169f0388c3afb4feb1 /docs
parent2658e870d21dc03096740f17fa869463136d3fae (diff)
parentd3286952e6f99b3c1f8ba177d8caddc9544adea4 (diff)
downloadpodman-4aa90145bf611a7bc08ddff7e061a630154e8b40.tar.gz
podman-4aa90145bf611a7bc08ddff7e061a630154e8b40.tar.bz2
podman-4aa90145bf611a7bc08ddff7e061a630154e8b40.zip
Merge pull request #2826 from mheon/restart_policy
Add restart policy for containers
Diffstat (limited to 'docs')
-rw-r--r--docs/podman-create.1.md29
-rw-r--r--docs/podman-events.1.md1
-rw-r--r--docs/podman-run.1.md14
3 files changed, 21 insertions, 23 deletions
diff --git a/docs/podman-create.1.md b/docs/podman-create.1.md
index 6d7d983b6..851f5cf3d 100644
--- a/docs/podman-create.1.md
+++ b/docs/podman-create.1.md
@@ -567,11 +567,17 @@ If container is running in --read-only mode, then mount a read-write tmpfs on /r
**--restart=""**
-Not implemented.
+Restart policy to follow when containers exit.
+Restart policy will not take effect if a container is stopped via the `podman kill` or `podman stop` commands.
+Valid values are:
-Restart should be handled via a systemd unit files. Please add your podman
-commands to a unit file and allow systemd or your init system to handle the
-restarting of the container processes. See example below.
+- `no` : Do not restart containers on exit
+- `on-failure[:max_retries]` : Restart containers when they exit with a non-0 exit code, retrying indefinitely or until the optional max_retries count is hit
+- `always` : Restart containers when they exit, regardless of status, retrying indefinitely
+
+Please note that restart will not restart containers after a system reboot.
+If this functionality is required in your environment, you can invoke Podman from a systemd unit file, or create an init script for whichever init system is in use.
+To generate systemd unit files, please see *podman generate systemd*
**--rm**=*true*|*false*
@@ -859,21 +865,6 @@ the uids and gids from the host.
$ podman create --uidmap 0:30000:7000 --gidmap 0:30000:7000 fedora echo hello
```
-### Running a podman container to restart inside of a systemd unit file
-
-
-```
-[Unit]
-Description=My App
-[Service]
-Restart=always
-ExecStart=/usr/bin/podman start -a my_app
-ExecStop=/usr/bin/podman stop -t 10 my_app
-KillMode=process
-[Install]
-WantedBy=multi-user.target
-```
-
### Rootless Containers
Podman runs as a non root user on most systems. This feature requires that a new enough version of shadow-utils
diff --git a/docs/podman-events.1.md b/docs/podman-events.1.md
index da142c0fb..3ccecac28 100644
--- a/docs/podman-events.1.md
+++ b/docs/podman-events.1.md
@@ -28,6 +28,7 @@ The *container* event type will report the follow statuses:
* pause
* prune
* remove
+ * restart
* restore
* start
* stop
diff --git a/docs/podman-run.1.md b/docs/podman-run.1.md
index 9efb7f51c..db90ce50e 100644
--- a/docs/podman-run.1.md
+++ b/docs/podman-run.1.md
@@ -589,11 +589,17 @@ If container is running in --read-only mode, then mount a read-write tmpfs on /r
**--restart=""**
-Not implemented.
+Restart policy to follow when containers exit.
+Restart policy will not take effect if a container is stopped via the `podman kill` or `podman stop` commands.
+Valid values are:
-Restart should be handled via a systemd unit files. Please add your podman
-commands to a unit file and allow systemd or your init system to handle the
-restarting of the container processes. See *podman generate systemd*.
+- `no` : Do not restart containers on exit
+- `on-failure[:max_retries]` : Restart containers when they exit with a non-0 exit code, retrying indefinitely or until the optional max_retries count is hit
+- `always` : Restart containers when they exit, regardless of status, retrying indefinitely
+
+Please note that restart will not restart containers after a system reboot.
+If this functionality is required in your environment, you can invoke Podman from a systemd unit file, or create an init script for whichever init system is in use.
+To generate systemd unit files, please see *podman generate systemd*
**--rm**=*true*|*false*