podman doesn't honour `init_path` for its pause containers
Issue Description
Changing the init_path parameter in container.conf results in containers using a different init binary than the default (catatonit). However, pause containers created within pods still require catatonit (unless infra_image is explicitly passed). This generates an error if catatonit is not found in the system.
NOTE: since catatonit is GPLv3, it must be replaced in some systems.
Steps to reproduce the issue
Steps to reproduce the issue
- Install an alternative container init system (e.g.
tini) and uninstallcatatonit - Point
init_pathto the new init binary (e.g./usr/bin/tini) - Launch a pod (e.g.
podman kube play manifest.yml)
Describe the results you received
Error: image for service container: building local pause image: finding pause binary: exec: "catatonit": executable file not found in $PATH
Describe the results you expected
The pod starts normally, using the new init system for the containers.
podman info output
podman >= 4
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Interested in opening a PR to fix?
Sure, but I'd like to hear your thoughts on what the best approach would be. Currently you are using catatonit's -P flag to start a pause container. However most alternative init systems do not have this flag.
Also do you want catatonit to be a hard dependency of podman? If so, an alternative approach would be to re-license catatonit to Apache.
I think the solution here is to build your own image and then use that as infra_image in containers.conf, you can even customize the command with infra_command.
We cannot use a generic init binary. The -P to catatonit was added to support this use case. And I don't think it makes sense to support another init system for building the pause image. In fact, the init system is not even needed for the infra container, we need just a process that sits there and keeps the namespaces alive.
e.g. you could do:
infra_command = "top"
infra_image = "alpine"
Ok since @giuseppe gave a solution, I am closing. Feel free to continue the conversation here.
@giuseppe you're right that the init system is not directly related to the pause container, conceptually. But how it's currently set up both are entangled:
- From a user perspective the current behavior is unexpected. The user changes
init_pathto replace the init system and immediately gets an error that catatonit is not found. infra_commandandinfra_imagebecome not just options, but required arguments wheninit_pathis changed?- Some environments cannot rely on an additional image being available. They may not even have an internet connection to pull it from either, e.g. building locally from scratch
I see two approaches here:
- If catatonit is seen as a hard dependency of podman (because of default pause containers), then it should always be present in the system. Either merge it into podman or license it equally.
- If it's not a hard dependency, provide a default pause container that is not based on it.
Please let me know your thoughts
@cyphar WDYT on the license?
I think this is a fair issue. While it's relatively straight forward to install e.g. tini and override init_path, it's not so easy to replace the use of catatonit in the infra container. The fact that Podman can build the pause container image internally is very convenient. Like @gsalvatella mentioned, needing to pull an extra image can become a bit of a burden. So it's a bit unfortunate that Podman is hard wired to use catatonit for this (given its license).
we need just a process that sits there and keeps the namespaces alive.
Looking at the pause process used in the Kubernetes pause containers, and it seems to take on the role of an init / process reaper as well. Not quite sure if / why that's needed. But replacing catatonit with that static pause binary seems to work, i.e. Podman can start pods with the self-generated pause container.
Would it make sense to offer an option to specify an alternative executable for generating the pause container? Or maybe even bake such a pause process into podman, to lighten this GPL3 dependency.
we've picked catatonit because it is already a dependency for Podman, and it is a static binary. There is no pause process on the host that we can reuse. The same podman binary cannot be used since it has a lot of dynamic dependencies, as well as conmon.
I don't see a way to use tini or any other simple init program unless we add another feature there. There is no generic way to let them sit idle and replace the pause process.
So how exactly would you expect podman to behave in this case?
I still think you can build your image locally and use that for the infra container when you need such a level of control.
If re-licensing is out of the question, could an alternative be using an additional binary that does just the pausing? It would be extremely simple and decouple the init system from the default pause container.
You could do this yourself and just store it where catatonit is installed.
Sure, but it would still be a hack. Users won't expect that changing the init system breaks their application because pause containers can't be started anymore. Why not properly separating these concerns?
Mainly because this is the first time this concern was raised Most users are fine with gplv3 code and use catonit. If you want to change the way it works, I suggest you open a PR and handle all the corner cases.
let's try the simplest thing first :) @cyphar, would you have problems relicensing catatonit to gplv2+?
@rhatdan I'd be ok with it :smiley:, but sure, let's see if the most direct approach works first...
I would have to ask all of the other contributors whether they'd be willing to relicense it. Let me take a look at how feasible that is... (I might go with MPLv2 or something.)
AFAICS, aside from @vrothberg and @giuseppe and a SUSE guy there's only one other contributor to catatonit.c (who submitted a trivial-but-correct one-line patch). We can try to ping them to ask if they would be okay with changing the license (though I think legally speaking we wouldn't actually need their approval, it's much better to be safe than sorry).
@cyphar There's actually an issue opened there for more than a year now. Maybe you want to discuss it there?
@cyphar I am OK :+1: