On Sun, Dec 08, 2024 at 05:43:38PM +0300, Michael Tokarev via Postfix-users
wrote:
> But a package might be installed from another system for example
> (bootstrapping) where host name is not required to be set, or during
> regular system setup when host name part hasn't been done yet, or in
> numerous other contexts, where the environment isn't set up (yet).
DO NOT attempt to build database tables, except just-in-time, shortly
before Postfix is ready to be started. Otherwise, you cannot know the
desired value of various supporting parameters, that may depend on the
system environment:
- default_database_type
- alias_database
- ...
In other words, run "newaliases" in the start script, not at package
build time. If you're upgrading a "live" system, you may be able to in
some cases just rebuild the alias table (perhaps atomically) and leave
Postfix running, if the file format is somehow known stable, but a
restart is generally required, because that's hard to know for some
unknown database type, and whether packages you've installed affect
its on disk layout.
> Another example is postmulti -- for example, in order to just list all
> configured instances - like for a simple call to `postmulti -l`,
> network_interfaces parameter should already be valid:
>
> # postmulti -l
> postmulti: fatal: config variable inet_interfaces: host not found: eth0
Again you should not attempt to query this information until the system
is in a runnable state. Leave behind one-time hooks to run once the
system is ready, or if live enough do a Postfix restart that will run
the hooks.
> Can't at least some tools be made to not require complete valid configuration?
Not reliably.
--
Viktor.
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]