10.12.2024 00:22, Wietse Venema via Postfix-users wrote:
On my FreeBSSD system, Postfix has only one startup dependency,
and that is "LOGIN". If the system isn't ready for users then
it should not be running Postfix.
Would that be possible with systemd? Or is that too simple.
We're comparing apples and oranges here. Linux systems has much more
differences between each other than any FreeBSD system from other
FreeBSD system. FreeBSD has a significantly better defined set of
system components than linux has (if there's such a way as linux
definition of system components at all). Assortment of various
components is huge on linux, each has its own ways to configure
and query signal when the startup is finished, what it provides,
etc. So there's no simple solution.
Actually, systemd tries to fix this by giving uniform way to
express what things provide and what things want, produce a
consistent set primitives for all this. And yes I'm aware
of xkcd 927 :) - that's why I'm not suggesting we implement
systemd integration in upstream postfix (however, any attempt
to do so should be done "right" too).
Speaking of "LOGIN". There are multiple "levels" of "login"
possible. For example there's getty.target - it is completed
when all configured gettys are available, not very useful since
it only includes minimal set of services.
There's multi-user.target - things which should be started
for a multi-user environment. This does not include "login"
though, and this is the set of things which NEED to be started,
not something to be used as a dependency. postfix.service is
*part* of multi-user.target, ie, it works the other way 'round.
There's another "login" target, - graphical.target, which
brings up graphical login screen. But again, this one is
not a dependency but a dependeee, so to say (like rc3.d).
But still, it works just differently. There's a target which
gets started when the system starts. Like rc2.d or rc3.d -
the system should start everything in there. An example
of such target is multi-user.target. Postfix, many all
other services, is *part* of multi-user.target.
So when boots, the system starts everything which is part of
multi-user.target. But, basically, it uses a dependency-based
parallel make with Makefile in /etc/rc2.d/, instead of an
ordered list. So one has to fill the correct deps.
And the good news is that this is actually not difficult, -
I'm really curious which probs people are having with that,
a distribution-provided postfix.service should run just fine.
It depends on network and nss-lookup, and that's basically it.
Maybe there are some other missing deps, - I'd love to know
about this and add them accordingly.
Systemd brings some more things in addition to this. Basically,
it brings possibility to many a system dynamic where before it
were all static. Plugging in various kinds of devices including
usb network cards, moving to a different wifi network, all sorts
of things. This makes certain static-before things to be dynamic.
Even without systemd, people tried to use inet_interface=ethdhcp
(managed by dhcp), expecting postfix to follow the address change
(which can be done too, just not in the default distribution-
provided integration scripts).
To sum it up: downstream just need to file right deps for postfix
when using systemd. It is definitely not a task for upstream.
In systemd things works differently, but it does not mean it is
more complex (well, it is, but from a different PoV). If we
had dependency-based rcN.d, we'd had exactly the same question
about how to write inter-services dependencies within each rcN.d
level. I think anyway.
Thanks,
/mjt
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org