packages/utils/podman/files/podman.init
Oskari Rauta 5bb8844fe3 podman: update to 3.1.1
- Add support for AppArmor
 - Gracefully stop containers and pods on shutdown

I found out that If you change location of containers to persistent storage instead of tmpfs, starting them will fail unless they have been stopped. If this is the case that reboot has occurred before pods and containers have been stopped, they cannot be started, they have to be removed and re-created. Change in initscript tries to avoid that. Even if containers are running at tmpfs, this won't hurt. Still, if something happens and system hangs/reboots/etc, script won't save you from that. It's just a attempt to make things better.
I also enabled AppArmor support for future possibilities.

Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
2021-04-21 04:38:35 +03:00

20 lines
363 B
Bash
Executable file

#!/bin/sh /etc/rc.common
START=99
STOP=10
USE_PROCD=1
NAME=podman
PROG=/usr/bin/podman
start_service() {
[ -d /run/podman ] || mkdir -p /run/podman
procd_open_instance "podman"
procd_set_param command "$PROG" system service --time=0
procd_append_param command $command
procd_close_instance
}
shutdown() {
${PROG} pod stop -a
${PROG} container stop -a
}