Postfix as "normal" daemon under 18.04?
Colin Watson
cjwatson at ubuntu.com
Tue Feb 9 18:03:23 UTC 2021
On Tue, Feb 09, 2021 at 12:44:07PM -0500, Robert Heller wrote:
> I installed postfix on a Ubuntu 18.04 server and copied a batch of config
> files from a CentOS 6 system. But postfix under Ubuntu 18.04 is weird. The
> main postfix service file (/lib/systemd/system/postfix.service) does not
> actually start the daemon (like it does with a CentOS 7 system), instead there
> is a /lib/systemd/system/postfix at .service file, that gets called to create
> instances. What is going on here? Is there some strange and exotic magic
> involved?
That's how systemd supports services with multiple instances.
systemd.unit(5) (for instance) has some documentation of this.
postfix has been set up like this ever since systemd integration was
first added to it in Debian. Here are some notes that I've copied out
from the changelog:
* Add systemd integration (Closes: #715188, #755960)
Thanks to Cameron Norman and Shawn Landden for the initial work.
The final design looks like this:
- postfix.service is an empty service file which lets you manage
all instances together.
- each instance is controlled by a postfix at instance.service file
- postfix at instance services are brought into life by a new
systemd generator (postfix-instance-generator)
- the usage of "postmulti -p start/stop/reload" in postfix at .service
ensures that the service is not started if disabled at the
postmulti level
> Is it not possible to just run postfix as a regular deamon?
It still ends up being a normal daemon, just potentially multiple
instances of it in a way that's friendly to postmulti(1). There isn't a
supported way to disable the multiple-instance support (a system with a
single instance just ends up with postfix at -.service), so I'd suggest
rolling with it - stopping and starting postfix.service should still
have the effect of stopping and starting all instances, since the
template unit is set up with PartOf=postfix.service and so on.
--
Colin Watson (he/him) [cjwatson at ubuntu.com]
More information about the ubuntu-users
mailing list