-
Notifications
You must be signed in to change notification settings - Fork 11
run postfix in the foreground #9
Comments
Is running it with systemd inside the container an option? (fedora-init-container) It needs the OCI hooks to work, though, which aren't available on all distros. |
A long time, I tried to implement it via supervisord but saw, supervisord is not proper solution. But can not find it now. |
There also is https://github.com/Yelp/dumb-init |
So, systemd inside container is not an option now since we are able to run postfix without systemd. That should be our last option. supervisord = just no dumb-init, that doesn't help us much since the tool won't babysit the postfix master process. My point with this issue is: I want PID 1 in the container to be postfix (or some process from postfix package), that's it. |
Systemd is already installed (afaik its in the boltron docker base) and configured with unit files created in the postfix rpm specfile. This is still what the module installs, isn't it? Support is not too good outside of fedora/rhel, where docker can't invoke the oci-hooks needed for systemd. However, this disscussion has been held many times before in many places and I guess until the respective fedora committees officially recommend it, this should probably not be the standard setup. If there were a decision to made to move more towards oci containers on pure runc, where there's better support for this, I would definitely revisit this approach.
@TomasTomecek in this case systemd would obviously be PID 1 and systemd doesn't fit in with docker's "one process per container" maxim. Maybe we can do something like this? In Dockerfile: (edit: this first step might not be necessary)
and in start.sh:
edit: |
won't help since postfix forks and final daemon process is reparented, hence the babysit loop afterwards postfix seems to be a good candidate for runc/system container. The only thing is that runc doesn't handle networking, so it would probably need to run in host's network namespace. |
@LorbusChris Why do you want to have systemd in postfix container? Any specific reason? Personally, I don't want to have systemd in postfix container. Let's have postfix as PID 1. |
@phracek No specific reason, just an idea as I thought journal logging might be helpful. But really any solution that just works (tm) is fine with me. |
@TomasTomecek @phracek a change in Kubernetes 1.7 makes PID 1 unavailable for container processes: kubernetes/kubernetes#48937 (comment) |
@LorbusChris thanks for headsup, that could affect us. |
@TomasTomecek I just want to link kubernetes/kubernetes#48937 (comment) made by @rhatdan which pretty much sums up why systemd is useful inside containers. The ongoing discussion over there is also related to the PID 1 change. I believe it also indicates there will be a solution to support systemd init-containers. In your eyes using systemd might not be the cleanest solution, but I can only reiterate that this would give us the ability to gather and extract logs via journald, use systemd-timers within containers, potentially obsoleting cron jobs for that usecase. Also I guess it would make the creation of containerized packages/modules easier, as you'd just follow standard install path in most cases. I'd like to do something along the lines of this:
|
http://www.postfix.org/announcements/postfix-3.3.0.html
|
So I guess we're now just waiting for v3.3.0 to be packaged :) |
Yup. |
Before you guys start running down the road like me on system packaged 3.3.0, be sure to get 3.3.1 with the bugfix first:
|
Postfix 3.3.1 has arrived in Fedora! |
Usually, the containerized services are suppose to run in foreground, no forking. We are using
postfix start
and a loop which babysits the process, which is kind of odd.When checking Docker Hub and looking at existing solutions, everyone is using supervisord and using some kind of hacks. The only solution I really liked is this one -- invoking master program directly. Is that a better solution?
The text was updated successfully, but these errors were encountered: