aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-containers/podman/files/podman-restart-5.0.0_rc4.initd')
-rw-r--r--app-containers/podman/files/podman-restart-5.0.0_rc4.initd22
1 files changed, 22 insertions, 0 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
new file mode 100644
index 0000000..d02bd64
--- /dev/null
+++ b/app-containers/podman/files/podman-restart-5.0.0_rc4.initd
@@ -0,0 +1,22 @@
+#!/sbin/openrc-run
+# 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"
+
+command_user="${RUN_AS_USER:=root:root}"
+command="/usr/bin/podman"
+command_args="--log-level ${LOG_LEVEL:=info} start --all --filter restart-policy=always"
+
+depend() {
+ after net
+}
+
+stop() {
+ ebegin "Stopping all containers with restart-policy set to always"
+ ${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"
+}