mirror of
https://github.com/containers/podman.git
synced 2025-05-17 23:26:08 +08:00
Fix podman-restart.service when there are no containers
If no containers need to be restarted, podman-restart prints "Error: you must provide at least one name or id" then fails. Update the service file to handle start and stop symmetrically. See discussion in https://github.com/containers/podman/pull/25131 Signed-off-by: Andrew Sayers <andrew-github.com@pileofstuff.org>
This commit is contained in:
@ -10,7 +10,7 @@ Type=oneshot
|
||||
RemainAfterExit=true
|
||||
Environment=LOGGING="--log-level=info"
|
||||
ExecStart=@@PODMAN@@ $LOGGING start --all --filter restart-policy=always
|
||||
ExecStop=/bin/sh -c '@@PODMAN@@ $LOGGING stop $(@@PODMAN@@ container ls --filter restart-policy=always -q)'
|
||||
ExecStop=@@PODMAN@@ $LOGGING stop --all --filter restart-policy=always
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
|
Reference in New Issue
Block a user