aboutsummaryrefslogtreecommitdiffstats
path: root/community/podman/podman.initd
diff options
context:
space:
mode:
Diffstat (limited to 'community/podman/podman.initd')
-rw-r--r--community/podman/podman.initd37
1 files changed, 37 insertions, 0 deletions
diff --git a/community/podman/podman.initd b/community/podman/podman.initd
new file mode 100644
index 00000000000..76586631023
--- /dev/null
+++ b/community/podman/podman.initd
@@ -0,0 +1,37 @@
+#!/sbin/openrc-run
+supervisor=supervise-daemon
+
+name="Podman API service"
+description="Listening service that answers API calls for Podman"
+
+command=/usr/bin/podman
+command_args="system service ${podman_opts:=--time 0} $podman_uri"
+command_user="${podman_user:=root}"
+
+extra_commands="start_containers"
+description_start_containers="Start containers with restart policy set to always"
+
+depend() {
+ need sysfs cgroups
+}
+
+start_containers() {
+ ebegin "Starting containers with restart policy set to always"
+ su "$podman_user" -s /bin/sh -c "$command start --all --filter restart-policy=always"
+ eend $?
+}
+
+start_pre() {
+ if [ "$podman_user" = "root" ]; then
+ einfo "Configured as rootful service"
+ checkpath -d -m 0755 /run/podman
+ else
+ einfo "Configured as rootless service"
+ modprobe tun
+ modprobe fuse
+ fi
+}
+
+start_post() {
+ start_containers
+}