You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/markdown/options/restart.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Valid _policy_ values are:
13
13
-`never` : Synonym for **no**; do not restart containers on exit
14
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
15
-`always` : Restart containers when they exit, regardless of status, retrying indefinitely
16
-
-`unless-stopped` : Identical to **always**
16
+
-`unless-stopped` : Restart containers when they exit, unless the container was explicitly stopped by the user. After a system reboot, containers with this policy will be restarted by podman-restart.service only if they were not explicitly stopped by the user before the reboot. This differs from **always**, which restarts containers after a system reboot regardless of whether they were user-stopped
17
17
18
18
Podman provides a systemd unit file, podman-restart.service, which restarts containers after a system reboot.
| until | [DateTime] Containers created before the given duration or time. |
46
48
| command | [Command] the command the container is executing, only argv[0] is taken |
49
+
| should-start-on-boot | [Bool] Containers that need to be restarted after system reboot. True for containers with restart policy 'always', or 'unless-stopped' that were not explicitly stopped by the user |
| should-start-on-boot |[Bool] Containers that need to be restarted after system reboot. True for containers with restart policy 'always', or 'unless-stopped' that were not explicitly stopped by the user |
65
67
66
68
#### **--format**=*format*
67
69
@@ -288,6 +290,14 @@ CONTAINER ID IMAGE COMMAND CREATED STATUS
288
290
5e3694604817 quay.io/centos/centos:latest sleep 300 3 minutes ago Up 3 minutes centos-test
289
291
```
290
292
293
+
Filter containers that need to be restarted after system reboot.
294
+
```
295
+
$ podman ps -a --filter should-start-on-boot=true
296
+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
297
+
ff660efda598 docker.io/library/nginx:latest nginx -g daemon o... 3 minutes ago Up 3 minutes 0.0.0.0:8080->80/tcp webserver
298
+
5693e934f4c6 docker.io/library/redis:latest redis-server 3 minutes ago Exited (0) 3 minutes ago 6379/tcp cache
299
+
```
300
+
291
301
Use custom format to show container and pod information.
292
302
```
293
303
$ podman ps --format "{{.Names}} is in pod {{.PodName}} ({{.Pod}})"
| until | [DateTime] Containers created before the given duration or time. |
49
51
| command | [Command] the command the container is executing, only argv[0] is taken |
52
+
| should-start-on-boot | [Bool] Containers that need to be restarted after system reboot. True for containers with restart policy 'always', or 'unless-stopped' that were not explicitly stopped by the user |
| until | [DateTime] Containers created before the given duration or time. |
53
55
| command | [Command] the command the container is executing, only argv[0] is taken |
56
+
| should-start-on-boot | [Bool] Containers that need to be restarted after system reboot. True for containers with restart policy 'always', or 'unless-stopped' that were not explicitly stopped by the user |
| until | [DateTime] Containers created before the given duration or time. |
54
56
| command | [Command] the command the container is executing, only argv[0] is taken |
57
+
| should-start-on-boot | [Bool] Containers that need to be restarted after system reboot. True for containers with restart policy 'always', or 'unless-stopped' that were not explicitly stopped by the user |
| until | [DateTime] Containers created before the given duration or time. |
52
54
| command | [Command] the command the container is executing, only argv[0] is taken |
55
+
| should-start-on-boot | [Bool] Containers that need to be restarted after system reboot. True for containers with restart policy 'always', or 'unless-stopped' that were not explicitly stopped by the user |
| until | [DateTime] Containers created before the given duration or time. |
46
48
| command | [Command] the command the container is executing, only argv[0] is taken |
49
+
| should-start-on-boot | [Bool] Containers that need to be restarted after system reboot. True for containers with restart policy 'always', or 'unless-stopped' that were not explicitly stopped by the user |
0 commit comments