Re: Keep Postfix running in the foreground

2018-04-05 Thread Postfix User
On Thu, 5 Apr 2018 07:07:06 -0400 (EDT), Wietse Venema stated: >Bastian Blank: >> On Wed, Apr 04, 2018 at 08:56:46PM -0400, Wietse Venema wrote: >> > That may be so, but why does the lame Linux kernel silently ignore >> > the kill() call instead of properly returning an error. >> >> The

Re: Keep Postfix running in the foreground

2018-04-05 Thread Wietse Venema
Thank you both for verifying that PID-1 mode now works as expected. It saved me a few hours to set stuff up and do it myself; my time for Postfix is very limited. Wietse

Re: Keep Postfix running in the foreground

2018-04-05 Thread A. Schulze
Eray Aslan: On Wed, Apr 04, 2018 at 07:19:56PM -0400, Wietse Venema wrote: I also need you guys to verify that with the Postfix master running as PID=1, "docker stop" will no longer leave the master daemon running until Docker times out and forcibly terminates everything. By default, "docker

Re: Keep Postfix running in the foreground

2018-04-05 Thread Wietse Venema
Bastian Blank: > On Wed, Apr 04, 2018 at 08:56:46PM -0400, Wietse Venema wrote: > > That may be so, but why does the lame Linux kernel silently ignore > > the kill() call instead of properly returning an error. > > The signal is ignored the same way as if someone had called > | signal(SIGFOO,

Re: Keep Postfix running in the foreground

2018-04-04 Thread Bastian Blank
On Wed, Apr 04, 2018 at 08:56:46PM -0400, Wietse Venema wrote: > That may be so, but why does the lame Linux kernel silently ignore > the kill() call instead of properly returning an error. The signal is ignored the same way as if someone had called | signal(SIGFOO, SIG_IGN) Bastian -- You!

Re: Keep Postfix running in the foreground

2018-04-04 Thread HAKNER J
>That may be so, but why does the lame Linux kernel silently ignore >the kill() call instead of properly returning an error. > > Wietse :) I don't write the code, just reporting the bad news! I think however the reasoning is as follows: clearly a user-mode process can send a signal to

Re: Keep Postfix running in the foreground

2018-04-04 Thread Wietse Venema
HAKNER J: > > > > >>> I'd appreciate it if someone could verify that this will run the > > > > >>> master daemon with PID 1, and that 'postfix stop' in the container > > > > >>> will stop the master daemon. If it doesn't, then Linux does weird > > > > >>> stuff with PID 1 processes. > > Correct.

Re: Keep Postfix running in the foreground

2018-04-04 Thread HAKNER J
> > > >>> I'd appreciate it if someone could verify that this will run the > > > >>> master daemon with PID 1, and that 'postfix stop' in the container > > > >>> will stop the master daemon. If it doesn't, then Linux does weird > > > >>> stuff with PID 1 processes. Correct. The Linux kernel

Re: Keep Postfix running in the foreground

2018-04-04 Thread Wietse Venema
Wietse Venema: > Wietse Venema: > > A. Schulze: > > > Am 04.04.2018 um 19:08 schrieb Wietse Venema: > > > > Eray Aslan: > > > >> On Tue, Apr 03, 2018 at 07:46:42PM -0400, Wietse Venema wrote: > > > >>> I updated both the postfix-script file and the master daemon. > > > >>> > > > >>> I'd appreciate

Re: Keep Postfix running in the foreground

2018-04-04 Thread Wietse Venema
Wietse Venema: > A. Schulze: > > Am 04.04.2018 um 19:08 schrieb Wietse Venema: > > > Eray Aslan: > > >> On Tue, Apr 03, 2018 at 07:46:42PM -0400, Wietse Venema wrote: > > >>> I updated both the postfix-script file and the master daemon. > > >>> > > >>> I'd appreciate it if someone could verify

Re: Keep Postfix running in the foreground

2018-04-04 Thread Wietse Venema
A. Schulze: > Am 04.04.2018 um 19:08 schrieb Wietse Venema: > > Eray Aslan: > >> On Tue, Apr 03, 2018 at 07:46:42PM -0400, Wietse Venema wrote: > >>> I updated both the postfix-script file and the master daemon. > >>> > >>> I'd appreciate it if someone could verify that this will run the > >>>

Re: Keep Postfix running in the foreground

2018-04-04 Thread A. Schulze
Am 04.04.2018 um 19:08 schrieb Wietse Venema: > Eray Aslan: >> On Tue, Apr 03, 2018 at 07:46:42PM -0400, Wietse Venema wrote: >>> I updated both the postfix-script file and the master daemon. >>> >>> I'd appreciate it if someone could verify that this will run the >>> master daemon with PID 1,

Re: Keep Postfix running in the foreground

2018-04-04 Thread Wietse Venema
Viktor Dukhovni: > > > > On Apr 4, 2018, at 1:31 PM, Wietse Venema wrote: > > > > According to RTFM, the exit() function does not return so it can't 'fail'. > > > > FreeBSD: > > The exit() and _Exit() functions never return. > > The _exit() system call can never

Re: Keep Postfix running in the foreground

2018-04-04 Thread Viktor Dukhovni
> On Apr 4, 2018, at 1:31 PM, Wietse Venema wrote: > > According to RTFM, the exit() function does not return so it can't 'fail'. > > FreeBSD: > The exit() and _Exit() functions never return. > The _exit() system call can never return. > Linux: > The exit()

Re: Keep Postfix running in the foreground

2018-04-04 Thread Wietse Venema
Wietse Venema: > Just for the heck of it, can you replace in src/master/master_sig.c > this code: > >if (kill(pid, SIGKILL) < 0) >msg_fatal("%s: kill myself: %m", myname); > > With this code: > >exit(0); > > And see if that fixes the PID=1 behavior? Viktor Dukhovni: > Perhaps

Re: Keep Postfix running in the foreground

2018-04-04 Thread Viktor Dukhovni
> On Apr 4, 2018, at 1:08 PM, Wietse Venema wrote: > > Just for the heck of it, can you replace in src/master/master_sig.c > this code: > >if (kill(pid, SIGKILL) < 0) >msg_fatal("%s: kill myself: %m", myname); > > With this code: > >exit(0); > > And

Re: Keep Postfix running in the foreground

2018-04-04 Thread Wietse Venema
Eray Aslan: > On Tue, Apr 03, 2018 at 07:46:42PM -0400, Wietse Venema wrote: > > I updated both the postfix-script file and the master daemon. > > > > I'd appreciate it if someone could verify that this will run the > > master daemon with PID 1, and that 'postfix stop' in the container > > will

Re: Keep Postfix running in the foreground

2018-04-04 Thread Eray Aslan
On Tue, Apr 03, 2018 at 07:46:42PM -0400, Wietse Venema wrote: > I updated both the postfix-script file and the master daemon. > > I'd appreciate it if someone could verify that this will run the > master daemon with PID 1, and that 'postfix stop' in the container > will stop the master daemon.

Re: Keep Postfix running in the foreground

2018-04-04 Thread Ralph Seichter
On 03.04.2018 02:37, John Stoffel wrote: > But... isn't discourse running in it's own container, so you'd be > spinning up postfix it another container... John Allen asked "what is the attraction of docker", and I was just mucking about with a new Discourse installation, so I mentioned this as

Re: Keep Postfix running in the foreground

2018-04-04 Thread A. Schulze
Wietse Venema: I'd appreciate it if someone could verify that this will run the master daemon with PID 1, and that 'postfix stop' in the container will stop the master daemon. I'll verify that in the next days ... Andreas

Re: Keep Postfix running in the foreground

2018-04-03 Thread Wietse Venema
> > anyway, the patched version run master as PID 1. fine! > > Good enough for proof of concept. The only misfeature is that it > passes -d to all child processes. I will add a new flag that does > less than '-d', only the things that containers need. postfix-3.4-20180403 will try to run the

Re: Keep Postfix running in the foreground

2018-04-03 Thread Eray Aslan
On Mon, Apr 02, 2018 at 01:21:41PM -0400, Viktor Dukhovni wrote: > A simple minder process that propagates signal to its child process > would probably solve this issue. On a somewhat related note, dumb-init[1] and tini[2] are populer choices to run as pid 1 inside containers. Perhaps, they

Re: Keep Postfix running in the foreground

2018-04-02 Thread John Stoffel
> "Ralph" == Ralph Seichter writes: Ralph> On 02.04.2018 19:55, John Allen wrote: >> what is the attraction of docker? What does it do that I might need? Ralph> You might need it because a Docker container is the recommended method Ralph> to deploy Discourse,

Re: Keep Postfix running in the foreground

2018-04-02 Thread Wietse Venema
A. Schulze: > > > Am 02.04.2018 um 19:30 schrieb Wietse Venema: > > - "") exec $daemon_directory/master > > + "") exec $daemon_directory/master -d > > + $FATAL "could not start-fg $daemon_directory/master" > > version 3.3.0 don't contain the "exec

Re: Keep Postfix running in the foreground

2018-04-02 Thread A. Schulze
Am 02.04.2018 um 19:30 schrieb Wietse Venema: > - "") exec $daemon_directory/master > + "") exec $daemon_directory/master -d > + $FATAL "could not start-fg $daemon_directory/master" version 3.3.0 don't contain the "exec $daemon_directory/master" but only

Re: Keep Postfix running in the foreground

2018-04-02 Thread Ralph Seichter
On 02.04.2018 19:55, John Allen wrote: > what is the attraction of docker? What does it do that I might need? You might need it because a Docker container is the recommended method to deploy Discourse, which I am doing right now... SCNR. ;-) -Ralph

Re: Keep Postfix running in the foreground

2018-04-02 Thread John Allen
Dumb question I suspect - what is the attraction of docker? What does it do that I might need? JohnA On April 2, 2018 1:22:29 PM Viktor Dukhovni wrote: > On Apr 2, 2018, at 12:42 PM, Wietse Venema wrote: > > To make the master 'pid 1' one

Re: Keep Postfix running in the foreground

2018-04-02 Thread Wietse Venema
Wietse Venema: > To make the master 'pid 1' one would have to use 'exec > $daemon_directory/master' in the 'postfix-script' file. > > However, that fails on every system that I know: > > postfix-master[xxx]: fatal: unable to set session and process group ID: > Operation not permitted Just

Re: Keep Postfix running in the foreground

2018-04-02 Thread Viktor Dukhovni
> On Apr 2, 2018, at 12:42 PM, Wietse Venema wrote: > > To make the master 'pid 1' one would have to use 'exec > $daemon_directory/master' in the 'postfix-script' file. > > However, that fails on every system that I know: > >postfix-master[xxx]: fatal: unable to set

Re: Keep Postfix running in the foreground

2018-04-02 Thread Wietse Venema
A. Schulze: > > > Am 02.04.2018 um 16:10 schrieb Michael Segel: > > Has anyone successfully implemented a Kubernetes / Docker container setup > > for Postfix/Dovecot? > > it works in my lab environment. > > $ docker-compuse up -d postfix > Creating dockerpostfix_postfix_1 ... done > $

Re: Keep Postfix running in the foreground

2018-04-02 Thread A. Schulze
Am 02.04.2018 um 16:10 schrieb Michael Segel: > Has anyone successfully implemented a Kubernetes / Docker container setup for > Postfix/Dovecot? it works in my lab environment. $ docker-compuse up -d postfix Creating dockerpostfix_postfix_1 ... done $ docker-compose exec postfix /bin/bash

Re: Keep Postfix running in the foreground

2018-04-02 Thread Wietse Venema
> >> On 12/19/2017 05:25 AM, Wietse Venema wrote: > >>> As for forgrounding, this must happen only after the 'postfix > >>> check' sanity checks and repairs complete sucessfully. Running a > >>> 'bare' master daemon would violate design assumptions. So this > >>> will require a new 'postfix'

Re: Keep Postfix running in the foreground

2018-04-02 Thread Michael Segel
Hi, Jumping late in to this thread… Has anyone successfully implemented a Kubernetes / Docker container setup for Postfix/Dovecot? > On Dec 19, 2017, at 9:06 AM, Wietse Venema wrote: > > Stephen Satchell: >> On 12/19/2017 05:25 AM, Wietse Venema wrote: >>> As for

Re: PATCH: Keep Postfix running in the foreground

2017-12-19 Thread Wietse Venema
Eray Aslan: > On Tue, Dec 19, 2017 at 10:53:38AM -0500, Wietse Venema wrote: > > Postfix will bail out if it knows that the queue or data directory > > are shared, because that can result in data corruption. > > > > How do I enforce that constraint when directories are imported into > > a

Re: PATCH: Keep Postfix running in the foreground

2017-12-19 Thread Eray Aslan
On Tue, Dec 19, 2017 at 10:53:38AM -0500, Wietse Venema wrote: > Postfix will bail out if it knows that the queue or data directory > are shared, because that can result in data corruption. > > How do I enforce that constraint when directories are imported into > a container from the host? I

Re: PATCH: Keep Postfix running in the foreground

2017-12-19 Thread Wietse Venema
Viktor Dukhovni: > > > > On Dec 19, 2017, at 10:19 AM, Eray Aslan wrote: > > > > Usually sending log output to console is the preferred approach. If we > > cannot do it natively, having syslog daemon write to console (in > > addition to local log file?) looks like a better

Re: PATCH: Keep Postfix running in the foreground

2017-12-19 Thread Viktor Dukhovni
> On Dec 19, 2017, at 10:19 AM, Eray Aslan wrote: > > Usually sending log output to console is the preferred approach. If we > cannot do it natively, having syslog daemon write to console (in > addition to local log file?) looks like a better option than importing > sockets

Re: PATCH: Keep Postfix running in the foreground

2017-12-19 Thread Wietse Venema
Eray Aslan: > On Tue, Dec 19, 2017 at 10:01:53AM -0500, Wietse Venema wrote: > > I suppose one approach is to make a Postfix container disposable, > > i.e. a container is never updated with a new Postfix version, but > > it is replaced with a newer one > > That is the common Docker approach.

Re: PATCH: Keep Postfix running in the foreground

2017-12-19 Thread Eray Aslan
On Tue, Dec 19, 2017 at 10:01:53AM -0500, Wietse Venema wrote: > I suppose one approach is to make a Postfix container disposable, > i.e. a container is never updated with a new Postfix version, but > it is replaced with a newer one That is the common Docker approach. Images are immutable. >

Re: Keep Postfix running in the foreground

2017-12-19 Thread Wietse Venema
Stephen Satchell: > On 12/19/2017 05:25 AM, Wietse Venema wrote: > > As for forgrounding, this must happen only after the 'postfix > > check' sanity checks and repairs complete sucessfully. Running a > > 'bare' master daemon would violate design assumptions. So this > > will require a new

PATCH: Keep Postfix running in the foreground

2017-12-19 Thread Wietse Venema
Wietse Venema: > I think that Docker fundamentally wants one service instance per > container. On Postfix service instance translates into one queue, > for example submission+smtp sharing one queue, similar to http+https > sharing one website. Let's not fight the Docker approach, and leave >

Re: Keep Postfix running in the foreground

2017-12-19 Thread Stephen Satchell
On 12/19/2017 05:25 AM, Wietse Venema wrote: As for forgrounding, this must happen only after the 'postfix check' sanity checks and repairs complete sucessfully. Running a 'bare' master daemon would violate design assumptions. So this will require a new 'postfix' subcommand that starts exactly

Re: Keep Postfix running in the foreground

2017-12-19 Thread Wietse Venema
Viktor Dukhovni: > > > > On Dec 18, 2017, at 9:09 PM, Wietse Venema wrote: > > > > The Docker approach complicates Postfix multi-instance support so > > we may have to forego that. What remains is to determine that Docker > > shutdown, i.e. yanking the container from

Re: Keep Postfix running in the foreground

2017-12-18 Thread Viktor Dukhovni
> On Dec 18, 2017, at 9:09 PM, Wietse Venema wrote: > > The Docker approach complicates Postfix multi-instance support so > we may have to forego that. What remains is to determine that Docker > shutdown, i.e. yanking the container from under a running Postfix > system,

Re: Keep Postfix running in the foreground

2017-12-18 Thread Wietse Venema
Dennis Carr: > On Tue, 26 Sep 2017 21:21:56 +0200 > A Debian User 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

Re: Keep Postfix running in the foreground

2017-12-18 Thread Dennis Carr
On Tue, 26 Sep 2017 21:21:56 +0200 A Debian User 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. I don't know

Re: Keep Postfix running in the foreground

2017-09-26 Thread Viktor Dukhovni
> On Sep 26, 2017, at 3:21 PM, A Debian User > 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

Re: Keep Postfix running in the foreground

2017-09-26 Thread 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

Keep Postfix running in the foreground

2017-09-26 Thread 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/_