Hi Sean, On Thu, Nov 14, 2024 at 10:16:15AM +0800, Sean Whitton wrote: > I struggle to see why logging is special, in this case. > > Why isn't an MTA a system facility? Well, because many many systems > don't need an MTA at all.
This is asking a very sensible question that helps us getting closer to the core of the matter. Thank you! To me there are multiple aspects that indeed make it special. If logging fails, applications typically ignore the error and move on. There isn't much they can do if logging fails. I mean for many other kinds of failures you might log a message or abort execution. Neither of these makes sense when logging fails. It is a facility whose absence tends to be handled gracefully. Some container runtimes provide logging. This is a relatively recent development, but it makes logging somewhat similar to the Linux kernel. You don't depend on a new kernel package when you need new syscalls and even if you were, that would be no guarantuee that you'd actually be running a recent kernel. I'm only aware of one container deployment where smtp service is part of the runtime and that's fairly idiosyncratic and the way of doing it is providing 127.0.0.1:25. Commonly though, the expectation of a local MTA is to also provide /usr/bin/sendmail. If you happen to usr /usr/bin/logger on the other hand, what you need is bsdutils and not the logging service. And then the amount of installations that have logging services by default also is an aspect to consider. We basically take for granted that every system that is running systemd as pid 1 (container or not) is providing logging services. This group of systems is now a strong majority. On the flip side, all kinds of build environments are not providing logging services even if you depend on system-log-daemon. As a result, the benefit of expressing this dependency is relatively low. These may not be the strong reasons that you were looking for and each of them in isolation would not be convincing me. It is more the sum of them and I recognize that your conclusion may differ from mine here. Helmut