1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-21 10:15:12 +03:00
aports/community/podman/podman.initd
Michał Polański bcfbdac68b community/podman: add start_containers command to initscript
this command starts containers with restart policy set to always
2023-01-26 02:55:51 +01:00

37 lines
851 B
Bash

#!/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
}