Am 08.05.2017 um 20:54 schrieb Scott Kitterman:

Hi Scott,


> In the postinst, if the debconf configuration is something other than none or 
> local, we create an override file with After=network-online.target, which is 
> what I think is needed in most of these cases.  I did not add it to the 
> service file because the documentation I read cautioned against using it when 
> not absolutely required.
> 
> The big question that's left unanswered for me is do I need it for 
> postfix@.service too?  Do I need to depend on some other service?

My proposal for stretch (minimal intrusive) would be to add

After=postfix.service

to postfix@.service.

This would (transitively) order postfix@.service after network.target,
which means users of ifupdown/systemd-networkd will have networking
configured at this point. I don't think we'd need network-online.target,
there is nothing in most postfix configurations that actually needs
network access to work on startup.

If I understand this correctly an additional benefit of ordering
postfix@.service after postfix.service is that "service postfix reload"
in various hooks will actually work when any instance is running.

I have tested this on top of 3.1.4-4 and it works for me.



I don't fully grasp the service override anyway.

    if [ -f /lib/systemd/systemd-resolved ] && \
        [ ! -f /etc/systemd/system/postfix.service.d/override.conf ] ; then
        if [ "$mailer" != "No configuration" ] && [ "$mailer" != "Local
only" ]; then
            echo "Adding systemd overrides to ensure network and name
services available."
            add_service_override
        fi
    fi

/lib/systemd/systemd-resolved is part of systemd, so the first part
always evaluates to "true" if systemd is installed. If it wasn't adding
the override file would have no consequences, so why bother with the
conditional here?

Second, the override adds

[Unit]
After=network-online.target
After=systemd-resolved.service

I think network-online.target is unnecessary, as I'm not aware of any
common postfix configurations that actually need network access to
startup. At least the common case of postfix or SQL the connection is
only made when a mail is getting processed.

systemd-resolved is debatable I think. But I don't see a reason not to
add it to the master postfix.service, it's just ordering and will not
start systemd-resolved by itself.

Bernhard

Reply via email to