You could use `--cgroups=disabled` when starting Podman,
which will keep it in the same cgroup as the systemd unit and
allow systemd to kill the container process as well. This does
require the use of the `crun` OCI runtime (the default
everywhere what's not RHEL and CentOS) and disable some Podman
features, though (most notably resource limits, but a few more
as well).
Thanks,
Matt Heon
I actually tested about the same. My outer process is
running as a systemd service and then starts a podman
container as part of its work. This also does not
make sure that the container gets killed when the service
gets kill. Systemd kills all process that are part of the
service (using KillMode=mixed) but it is not able to kill
all podman processes. I assume it is due to them not being
in the same cgroup. I can only somewhat resolve it by
systemd restarting my service on failure and then I can
cleanup any still running container