So I've now configured init mode in foreground with logging properly on
stdout and your patch applied to the last 3.5 snapshot and I got the
same panic, although this time not against my piped spamd process,
rather smtpd, it would appear:

/ # ps
PID   USER     TIME  COMMAND
    1 root      0:00 /usr/libexec/postfix/master -i
   75 postfix   0:00 pickup -l -t unix -u
   76 postfix   0:00 qmgr -l -t unix -u
   77 postfix   0:00 postlogd -l -n postlog -t unix-dgram -u
 *  78 postfix   0:00 smtpd -n smtp -t inet -u -o stress=*
   79 postfix   0:00 tlsmgr -l -t unix -u
   80 postfix   0:00 anvil -l -t unix -u
   81 postfix   0:00 trivial-rewrite -n rewrite -t unix -u
   82 postfix   0:00 spawn -z -n policyd-spf -t unix user=policyd-spf
argv=/usr/bin/policyd-spf /policyd-spf/config/policyd-spf.conf
   83 policyd-  0:01 {policyd-spf} /usr/bin/python3.6
/usr/bin/policyd-spf /policyd-spf/config/policyd-spf.conf
   84 postfix   0:00 cleanup -z -t unix -u
   85 postfix   0:00 pipe -n spamassassin -t unix user=spamc
argv=/usr/bin/spamc -d mail-spamassassin-0.mail-spamassassin-service -e
/usr/sbin/sendmail -oi -f ${sender} ${recipient}
   89 postfix   0:00 lmtp -t unix -u
   90 root      0:00 /bin/sh
   97 root      0:00 ps
/ # command terminated with exit code 137

tgerczei@altar ~ $ kc logs po/mail-postfix-0 -f
Feb 18 09:33:39 mail-postfix-0 postfix/postfix-script[63]: warning:
group or other writable: /postfix/config-live/.
Feb 18 09:33:39 mail-postfix-0 postfix/postfix-script[74]: starting the
Postfix mail system
Feb 18 09:33:39 mail-postfix-0 postfix/master[1]: daemon started --
version 3.5-20190212, configuration /postfix/config-live
Feb 18 09:35:14 mail-postfix-0 postfix/smtpd[78]: connect from
mail-qt1-f182.google.com[209.85.160.182]
Feb 18 09:35:15 mail-postfix-0 postfix/smtpd[78]: Anonymous TLS
connection established from mail-qt1-f182.google.com[209.85.160.182]:
TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
Feb 18 09:35:15 mail-postfix-0 postfix/smtpd[78]: NOQUEUE: filter: RCPT
from mail-qt1-f182.google.com[209.85.160.182]:
<gerczei.ta...@gmail.com>: Sender address triggers FILTER
spamassassin:dummy; from=<gerczei.ta...@gmail.com> to=<ta...@gerczei.eu>
proto=ESMTP helo=<mail-qt1-f182.google.com>
Feb 18 09:35:17 mail-postfix-0 postfix/smtpd[78]: 63C912D0E6C:
client=mail-qt1-f182.google.com[209.85.160.182]
Feb 18 09:35:17 mail-postfix-0 postfix/cleanup[84]: 63C912D0E6C:
message-id=<CADUGxUQdixE5euviwC2YM7i=sgwidjnmija9do3nx-qhqh4...@mail.gmail.com>
Feb 18 09:35:17 mail-postfix-0 postfix/qmgr[76]: 63C912D0E6C:
from=<gerczei.ta...@gmail.com>, size=2872, nrcpt=1 (queue active)
Feb 18 09:35:17 mail-postfix-0 postfix/smtpd[78]: disconnect from
mail-qt1-f182.google.com[209.85.160.182] ehlo=2 starttls=1 mail=1 rcpt=1
bdat=1 quit=1 commands=7
Feb 18 09:35:27 mail-postfix-0 postfix/pickup[75]: DBB5F2D0E71: uid=103
from=<gerczei.ta...@gmail.com>
Feb 18 09:35:27 mail-postfix-0 postfix/pipe[85]: 63C912D0E6C:
to=<ta...@gerczei.eu>, relay=spamassassin, delay=13,
delays=2.2/0.02/0/10, dsn=2.0.0, status=sent (delivered via spamassassin
service)
Feb 18 09:35:27 mail-postfix-0 postfix/qmgr[76]: 63C912D0E6C: removed
Feb 18 09:35:27 mail-postfix-0 postfix/cleanup[84]: DBB5F2D0E71:
message-id=<CADUGxUQdixE5euviwC2YM7i=sgwidjnmija9do3nx-qhqh4...@mail.gmail.com>
Feb 18 09:35:29 mail-postfix-0 postfix/qmgr[76]: DBB5F2D0E71:
from=<gerczei.ta...@gmail.com>, size=3497, nrcpt=1 (queue active)
Feb 18 09:35:29 mail-postfix-0 postfix/lmtp[89]: DBB5F2D0E71:
to=<ta...@gerczei.eu>,
relay=mail-dovecot-0.mail-dovecot-service.default.svc.cluster.local[10.244.1.53]:54321,
delay=2.9, delays=2.7/0.03/0.05/0.12, dsn=2.0.0, status=sent (250 2.0.0
<ta...@gerczei.eu> y4PZF2F8alx7GwAAHo2YKg Saved)
Feb 18 09:35:29 mail-postfix-0 postfix/qmgr[76]: DBB5F2D0E71: removed
*Feb 18 09:36:57 mail-postfix-0 postfix/master[1]: panic: master_reap:
unknown pid: 78*

I don't get this since smtpd had surely been spawned by master. Should I
have used 3.4? Does 3.5 have anything new in there in this regard?
(Anything below 3.4 wouldn't support logging to stdout, hence my choice.)

On 2019. 02. 17. 15:42, Wietse Venema wrote:
> Wietse Venema:
>> Tam?s G?rczei:
>>> Hello List,
>>>
>>> I'd like to ask whether You're aware of any change which might cause
>>> breakage in my setup involving spamc with a completely unchanged
>>> configuration in between - I'm getting the following error:
>>>
>>> *"panic: master_reap: unknown pid"*
>> Is the Postfix master daemon running as PID 1? Historically this
>> PID was reserved for the init daemon which becomes the parent of
>> orphaned processes, i.e. processes that terminate without a parent
>> waiting for them. Postfix does not create such processes, but if
>> you run other programs inside the Postfix container then they
>> might do that.
>>
>> Options:
>>
>> - Run Postfix as PID != 1.
>>
>> - Don't co-locate Postfix with other software. That means pipe into
>> socket instead of into a program in the same container.
>>
>> - Make the master sloppier, and accept events from processes that
>> it did not create.
> As per the patch below.
>
> --- src/master/master_spawn.c-        2014-12-06 20:35:33.000000000 -0500
> +++ src/master/master_spawn.c 2019-02-17 09:38:52.000000000 -0500
> @@ -301,8 +301,11 @@
>       if (msg_verbose)
>           msg_info("master_reap_child: pid %d", pid);
>       if ((proc = (MASTER_PROC *) binhash_find(master_child_table,
> -                                       (void *) &pid, sizeof(pid))) == 0)
> +                                     (void *) &pid, sizeof(pid))) == 0) {
> +         if (init_mode)
> +             continue;                       /* non-Postfix process */
>           msg_panic("master_reap: unknown pid: %d", pid);
> +     }
>       serv = proc->serv;
>  
>  #define MASTER_KILL_SIGNAL   SIGTERM

Reply via email to