DevHeads.net

reloading postfix with systemd

In v16.04 LTS, Ubuntu has switched to systemd.

"postfix reload" still seems to work just fine.
But I wonder if I should be using "systemctl reload postfix" instead.

Which method is preferred on systems that use systemd?
And if either method works, are there differences or reasons to prefer one
over the other?

Thanks,
Michael

Comments

Re: reloading postfix with systemd

By Julian Kippels at 08/10/2017 - 13:34

Am Thu, 10 Aug 2017 10:19:25 -0700
schrieb "Michael Fox" < ... at mefox dot org>:

Well at least in Redhat, if you do systemctl reload postfix it just
executes postfix reload internally. So it makes absolutely no
difference.

# cat /usr/lib/systemd/system/postfix.service
[Unit]
Description=Postfix Mail Transport Agent
After=syslog.target network.target
Conflicts=sendmail.service exim.service

[Service]
Type=forking
PIDFile=/var/spool/postfix/pid/master.pid
EnvironmentFile=-/etc/sysconfig/network
ExecStartPre=-/usr/libexec/postfix/aliasesdb
ExecStartPre=-/usr/libexec/postfix/chroot-update
ExecStart=/usr/sbin/postfix start
ExecReload=/usr/sbin/postfix reload
ExecStop=/usr/sbin/postfix stop

[Install]
WantedBy=multi-user.target

RE: reloading postfix with systemd

By Fazzina, Angelo at 08/10/2017 - 13:42

IMHO

I would think they both work for backwards compatibility and over time
"service postfix reload" will eventually be depreciated and no longer be a valid command.

I expect that to take years.
-ALF

-Angelo Fazzina
Operating Systems Programmer / Analyst
University of Connecticut,  UITS, SSG, Server Systems
860-486-9075

Cc: <a href="mailto:postfix- ... at postfix dot org">postfix- ... at postfix dot org</a>

Am Thu, 10 Aug 2017 10:19:25 -0700
schrieb "Michael Fox" < ... at mefox dot org>:

Well at least in Redhat, if you do systemctl reload postfix it just
executes postfix reload internally. So it makes absolutely no
difference.

# cat /usr/lib/systemd/system/postfix.service
[Unit]
Description=Postfix Mail Transport Agent
After=syslog.target network.target
Conflicts=sendmail.service exim.service

[Service]
Type=forking
PIDFile=/var/spool/postfix/pid/master.pid
EnvironmentFile=-/etc/sysconfig/network
ExecStartPre=-/usr/libexec/postfix/aliasesdb
ExecStartPre=-/usr/libexec/postfix/chroot-update
ExecStart=/usr/sbin/postfix start
ExecReload=/usr/sbin/postfix reload
ExecStop=/usr/sbin/postfix stop

[Install]
WantedBy=multi-user.target

Re: reloading postfix with systemd

By Bastian Blank at 08/10/2017 - 14:06

On Thu, Aug 10, 2017 at 05:42:44PM +0000, Fazzina, Angelo wrote:
Well. "postfix reload" != "service postfix reload".

Bastian