postfix startup sequence

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

postfix startup sequence

Fourhundred Thecat
Hello,

I am trying to understand the postfix startup sequence.

I am using postfix 3.4.5 on Debian.

/etc/init.d/postfix, the init script that is used to start postfix does
not start master directly, but calls:

  /usr/sbin/postfix quiet-quick-start

which in turn calls postfix-script. And than, postfix-script, after some
checks and housekeeping (post-install), starts master:

  /usr/lib/postfix/sbin/master &

At first sight, this looks very complicated.

Especially mysterious is, why post-install needs to be run at each start
to "create missing queue directories", and check if permissions
correspond to those defined in /etc/postfix/postfix-files

Why should queue directories be missing ? Other than somebody
deliberately deleting them, are there situations where this might happen?

If I am using simplest possible setup (single instance, no chroot), and
I don't delete queue directories, can I simply skip postfix-script and
post-install and start master directly from /etc/init.d/postfix, ie ?

  /usr/lib/postfix/sbin/master &

What exactly will I miss ?

I tried comparing running instances (one started in the standard way,
the other by calling "master &" directly). postconf prints identical
info in both cases.

thanks,
Reply | Threaded
Open this post in threaded view
|

Re: postfix startup sequence

Wietse Venema
Fourhundred Thecat:
> If I am using simplest possible setup (single instance, no chroot), and
> I don't delete queue directories, can I simply skip postfix-script and
> post-install and start master directly from /etc/init.d/postfix, ie ?
>
>   /usr/lib/postfix/sbin/master &
>
> What exactly will I miss ?

This is not supported. Only the postfix+postfix-script start/stop/etc
sequence is supported.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: postfix startup sequence

Fourhundred Thecat
> On 2019-11-12 13:08, Wietse Venema wrote:
>
> Fourhundred Thecat:
>> If I am using simplest possible setup (single instance, no chroot), and
>> I don't delete queue directories, can I simply skip postfix-script and
>> post-install and start master directly from /etc/init.d/postfix, ie ?
>>
>>   /usr/lib/postfix/sbin/master &
>>
>> What exactly will I miss ?
>
> This is not supported. Only the postfix+postfix-script start/stop/etc
> sequence is supported.

fair enough.

I am not so much looking for support with non-standard solutions. I am
just trying to understand the logic behind the startup process.

Such as, why post-install needs to be run at each start to "create
missing queue directories", and check if permissions correspond to those
defined in /etc/postfix/postfix-files

Why should these be missing in the first place ? Unless somebody deleted
them deliberately, are there other situations where queue directories
might go missing ?

I can read the scripts themselves, and try to understand what they are
doing. But the scripts don't explain the logic behind those decisions,
and the motivation.

Also, why use this complicated cascade to star master?

/etc/init.d/postfix
  -> /usr/sbin/postfix
    -> postfix-script
      -> post-install
        -> /usr/lib/postfix/sbin/master

surely, somebody has thought about these design decisions, and chose
this approach over other alternatives.
Reply | Threaded
Open this post in threaded view
|

Re: postfix startup sequence

Wietse Venema
Fourhundred Thecat:

> > On 2019-11-12 13:08, Wietse Venema wrote:
> >
> > Fourhundred Thecat:
> >> If I am using simplest possible setup (single instance, no chroot), and
> >> I don't delete queue directories, can I simply skip postfix-script and
> >> post-install and start master directly from /etc/init.d/postfix, ie ?
> >>
> >>   /usr/lib/postfix/sbin/master &
> >>
> >> What exactly will I miss ?
> >
> > This is not supported. Only the postfix+postfix-script start/stop/etc
> > sequence is supported.
>
> fair enough.
>
> I am not so much looking for support with non-standard solutions. I am
> just trying to understand the logic behind the startup process.

Because people screw up and set insecure permissions like making
everything owned by Postfix.

Because people screw up and shut down the system uncleanly. Postfix
startup scripts can repair some of the damage, and if it can't, it
will prevent Postfix from running, instead of making the probkem
worse.

Because people screw up the upgrade process and copy an old
config over the new one, thereby missing critical settings.

And so on.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: postfix startup sequence

A. Schulze
In reply to this post by Fourhundred Thecat


Am 12.11.19 um 03:52 schrieb Fourhundred Thecat:
>   /usr/sbin/postfix quiet-quick-start

this is Debian specific
https://sources.debian.org/src/postfix/3.4.5-1/debian/patches/09_quiet_startup.diff/

You've to ask on a Debian list because - Wietse already noted - it's unsupported

Andreas