by mikepurvis · 4y ago · 0 comments
I really like systemd, and I really don't like supervisor. So I'd love to figure out how to make this work.
I know the easiest thing would be to ignore the user mode business and just use podman, where the work has already been done [1], but at least in the short term that doesn't help for more restricted environments like cloud kubernetes.
[1]: https://www.redhat.com/sysadmin/improved-systemd-podman
This article led me to believe that I could run systemd in an unprivileged docker (not podman) container, but I did not find that to be the case. It was not happy until I added `--cap-add=SYS_ADMIN` capability, and then it started working.
My interim solution is running docker containers as user, using a simple USER directive. Straightforward and still added security benefits.
However, there are lots of applications out there (especially legacy ones, think stuff like Zoneminder) which are made up of multiple small daemon-type processes sharing state across ports and maybe even the filesystem, and have a strong reliance on system services like cron or log rotation. Yes, with effort an application like this could be be fully "ported" to a container-native setup, but the path of least resistance is often to just make the container environment present as being more like a full VM.
I prefer to just avoid any application that requires a service to in any way be configured to account for the app.
It's bad enough that Zigbee2MQTT is a separate process, but it's acceptable because it is a pure layering model and as long as you are local only and not needing passwords, there's no manual config.
Things like ZM that need an actual database are just insane. Multi-page configuration instructions for something that the(Sadly closed source) AgentDVR does with one process, no containers, no major configuration to conflict with anything else.
But modular apps exist, so we need containers to make them act like monoliths.