commit: 32737b5387c1c33f9a4c38f08995ebed85472393 Author: NN708 <nn708 <AT> Mac <DOT> lan> AuthorDate: Sun Feb 9 04:04:19 2025 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Sun Feb 9 17:55:10 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32737b53
app-containers/podman: fix restart behavior of unless-stopped Signed-off-by: NN708 <nn708 <AT> outlook.com> Closes: https://github.com/gentoo/gentoo/pull/40494 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> app-containers/podman/files/podman-restart-5.0.0_rc4.initd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app-containers/podman/files/podman-restart-5.0.0_rc4.initd b/app-containers/podman/files/podman-restart-5.0.0_rc4.initd index d02bd64c6279..62bea5bc12de 100644 --- a/app-containers/podman/files/podman-restart-5.0.0_rc4.initd +++ b/app-containers/podman/files/podman-restart-5.0.0_rc4.initd @@ -2,21 +2,21 @@ # Copyright 2015-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -description="Start all containers with restart-policy set to always" +description="Start all containers with restart-policy set to always or unless-stopped" command_user="${RUN_AS_USER:=root:root}" command="/usr/bin/podman" -command_args="--log-level ${LOG_LEVEL:=info} start --all --filter restart-policy=always" +command_args="--log-level ${LOG_LEVEL:=info} start --all --filter restart-policy=always --filter restart-policy=unless-stopped" depend() { after net } stop() { - ebegin "Stopping all containers with restart-policy set to always" + ebegin "Stopping all containers with restart-policy set to always or unless-stopped" ${command} \ --log-level ${LOG_LEVEL} \ stop \ - $(${command} container ls --filter restart-policy=always -q) - eend $? "Failed to stop containers with restart-policy set to always" + $(${command} container ls --filter restart-policy=always --filter restart-policy=unless-stopped -q) + eend $? "Failed to stop containers with restart-policy set to always or unless-stopped" }