How to set up a systemd system service (with User=
) that runs a caddy executable without conmon and the OCI runtime in the rootless podman network namespace?
#24626
-
How to set up a systemd system service (with systemd directive I would like the caddy process to serve as an HTTP reverse proxy for podman containers running in a custom network. Rootless Podman with Pasta is used for the containers in the custom network. First I tried with I think systemd didn't kill the process because caddy is not a direct child process of systemd (or some similar explanation related to cgroups). Anyway, I then tried using
That worked better. The command These two lines were added to let the service run with extra restrictions
This line
was added to be able to use the environment variable Any suggestions of how to improve this hackish solution that makes use of Maybe Podman could add support for this use case by
A tricky problem is how to decrease A sketch: (This syntax does not currently exist)
Note, this discussion thread has some similarities to but here |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I think using I have not looked deeply at the cgroup stuff but if the move out of the unit cgroup is the issue then maybe registry.NoMoveProcess option in the code that can be set on a per podman command basis. I think we can set it for podman unshare. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the input and the tip about I started drafting a PR (it's work-in-progress): Currently it makes use of
but using |
Beta Was this translation helpful? Give feedback.
I think using
podman unshare --rootless-netns
should work, there should no need to add any new options.I have no tried that but I guess it is possible that podman moves itself out of the cgroup because we do not own it? And the podman setup really wants a cgroup that it can modify?
I have not looked deeply at the cgroup stuff but if the move out of the unit cgroup is the issue then maybe registry.NoMoveProcess option in the code that can be set on a per podman command basis. I think we can set it for podman unshare.