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

depend() {
	need sysfs cgroups
}

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
}
