From 5bb8844fe3e8d6def59f76301acf4c294d38dd30 Mon Sep 17 00:00:00 2001 From: Oskari Rauta Date: Wed, 21 Apr 2021 00:18:27 +0300 Subject: [PATCH] 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 --- utils/podman/Makefile | 10 +++++----- utils/podman/files/podman.init | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/utils/podman/Makefile b/utils/podman/Makefile index 5c9744a44..c97ba3e22 100644 --- a/utils/podman/Makefile +++ b/utils/podman/Makefile @@ -1,9 +1,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=podman -PKG_VERSION:=3.0.1 +PKG_VERSION:=3.1.1 PKG_RELEASE:=$(AUTORELEASE) -PKG_HASH:=259e682d6e90595573fe8880e0252cc8b08c813e19408b911c43383a6edd6852 +PKG_HASH:=4e6fb106c6363566b6edc4ac6caee0bdf6b788e01255c3b3bfcb64f4b6842229 PKG_SOURCE_URL:=https://github.com/containers/podman/archive/v$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz @@ -17,7 +17,7 @@ PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 GO_PKG:=github.com/containers/podman/ -GO_PKG_BUILD_PKG:=github.com/containers/podman/v2/cmd/podman/ +GO_PKG_BUILD_PKG:=github.com/containers/podman/v3/cmd/podman/ include $(INCLUDE_DIR)/package.mk include ../../lang/golang/golang-package.mk @@ -79,9 +79,9 @@ endef Package/podman-selinux/conffiles = $(Package/podman/conffiles) ifeq ($(BUILD_VARIANT),selinux) - GO_PKG_TAGS=seccomp,exclude_graphdriver_devicemapper,selinux + GO_PKG_TAGS=seccomp,exclude_graphdriver_devicemapper,selinux,apparmor else - GO_PKG_TAGS=seccomp,exclude_graphdriver_devicemapper + GO_PKG_TAGS=seccomp,exclude_graphdriver_devicemapper,apparmor endif define Build/Prepare diff --git a/utils/podman/files/podman.init b/utils/podman/files/podman.init index 1df70407f..fe85646e7 100755 --- a/utils/podman/files/podman.init +++ b/utils/podman/files/podman.init @@ -1,6 +1,7 @@ #!/bin/sh /etc/rc.common START=99 +STOP=10 USE_PROCD=1 NAME=podman PROG=/usr/bin/podman @@ -12,3 +13,8 @@ start_service() { procd_append_param command $command procd_close_instance } + +shutdown() { + ${PROG} pod stop -a + ${PROG} container stop -a +}