Keep Postfix running in the foreground

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Keep Postfix running in the foreground

A Debian User

Hello,

I am currently having trouble to get postfix running in a Docker Container.

Docker requires a Process to stay alive and in foreground at ID 1, if not the container dies.

Is there any way to make it stay in the foreground, like it is possible for instance with apachectl -DFOREGROUND (Without scripts, supervisor, ...)?

Many thanks for helpful replies in advance!




Reply | Threaded
Open this post in threaded view
|

Re: Keep Postfix running in the foreground

Wietse Venema
A Debian User:

> Hello,
>
> I am currently having trouble to get postfix running in a Docker Container.
>
> Docker requires a Process to stay alive and in foreground at ID 1, if
> not the container dies.
>
> Is there any way to make it stay in the foreground, like it is possible
> for instance with _/apachectl -DFOREGROUND/_ (Without scripts,
> supervisor, ...)?
>
> Many thanks for helpful replies in advance!

That is not currently supported. You are welcome to send a patch
for the postfix-script file, for example to implement a "run"
command.  I don't see, however, how one would use this to implement
other management commands (postfix reload, postconf -e, postsuper,
etc.).

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Keep Postfix running in the foreground

Viktor Dukhovni
In reply to this post by A Debian User

> On Sep 26, 2017, at 3:21 PM, A Debian User <[hidden email]> wrote:
>
> Hello,
>
> I am currently having trouble to get postfix running in a Docker Container.
>
> Docker requires a Process to stay alive and in foreground at ID 1, if not the container dies.
>
> Is there any way to make it stay in the foreground, like it is possible for instance with apachectl -DFOREGROUND (Without scripts, supervisor, ...)?
>
> Many thanks for helpful replies in advance!

This is not supported or easy.  In multi-instance deployments Postfix
runs multiple independent master(8) processes.  None of them would be
a natural distinguished foreground top-level process.  There's no
"meta-master" that sticks around to manage all the underlying masters.

Even in a single-instance deployment, I don't see a suitable master(8)
option for staying in the foreground.  You might just need a dummy
process that launches Postfix as a background child process, and sticks
around forever, perhaps periodically trying to lock  the master lock
file and exiting if the lock is available.  This assumes that Docker
permits running background processes.  If not, then Postfix is not
a docker-compatible application.

--
        Viktor.