Systemd Alias For SMTP Provider (and Other Services Supplied By Alternative Providers)

Home » CentOS » Systemd Alias For SMTP Provider (and Other Services Supplied By Alternative Providers)
CentOS No Comments

I just finished adding a custom service to send an email on system shutdown/startup:

I ended up coding an After for postfix.service on CentOS 8 so the mail would get delivered before the system shut down. (I think I might need a delay, too, to allow the message to finish shipping to the monitoring server across the network.) I’d like to be able to use the same unit file on older systems that use sendmail, and I know there are other packages that provide SMTP and local mail. So it would be desirable to have an Alias for those services. I’m using CentOS 8 on my latest system and 7 on older systems. Is this perhaps already present in a newer systemd commit? Is there a registry for well-known aliases for package writers? With CentOS/RHEL/Fedora allowing multiple options for several packages through its alternatives system, this seems like a natural need.