reloading postfix with systemd

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

reloading postfix with systemd

Michael Fox
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
 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: reloading postfix with systemd

Julian Kippels
Am Thu, 10 Aug 2017 10:19:25 -0700
schrieb "Michael Fox" <[hidden email]>:

> 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
>  
>

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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: reloading postfix with systemd

Fazzina, Angelo
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

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Julian Kippels
Sent: Thursday, August 10, 2017 1:35 PM
To: Michael Fox <[hidden email]>
Cc: [hidden email]
Subject: Re: reloading postfix with systemd

Am Thu, 10 Aug 2017 10:19:25 -0700
schrieb "Michael Fox" <[hidden email]>:

> 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
>  
>

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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: reloading postfix with systemd

Bastian Blank-3
On Thu, Aug 10, 2017 at 05:42:44PM +0000, Fazzina, Angelo wrote:
> 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.

Well. "postfix reload" != "service postfix reload".

Bastian

--
Where there's no emotion, there's no motive for violence.
                -- Spock, "Dagger of the Mind", stardate 2715.1
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: reloading postfix with systemd

Michael Fox
In reply to this post by Julian Kippels
> 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

Hmm.  My Ubuntu system has no such file.

~$ sudo systemctl status postfix.service
● postfix.service - LSB: Postfix Mail Transport Agent
   Loaded: loaded (/etc/init.d/postfix; bad; vendor preset: enabled)
  Drop-In: /run/systemd/generator/postfix.service.d
           └─50-postfix-$mail-transport-agent.conf
   Active: active (running) since Wed 2017-08-09 10:20:02 PDT; 1 day 1h ago
     Docs: man:systemd-sysv-generator(8)
    Tasks: 4
   Memory: 6.5M
      CPU: 1.836s
   CGroup: /system.slice/postfix.service
           ├─ 1971 /usr/lib/postfix/sbin/master
           ├─20028 qmgr -l -t unix -u
           ├─20030 pickup -l -t unix -u -c
           └─20039 tlsmgr -l -t unix -u -c

I'm a newbie to systemd.  But I guess the above is telling me that the
postfix.service is auto-generated.
Looking at the file listed in "Drop-In", I don't see the reload command.

$ cat
/run/systemd/generator/postfix.service.d/50-postfix-\$mail-transport-agent.c
onf
# Automatically generated by systemd-insserv-generator

[Unit]
Wants=mail-transport-agent.target
Before=mail-transport-agent.target

The logical assumption would be that the auto-generated service would have
the same commands as "postfix ...".  
But I haven't yet figured out how to show/prove whether "postfix reload" =
"systemctl reload postfix"

Michael

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: reloading postfix with systemd

Mark Constable
On 11/08/17 05:20, Michael Fox wrote:
>> # cat /usr/lib/systemd/system/postfix.service
>
> Hmm.  My Ubuntu system has no such file.

On *buntu/deb machines it's...

/lib/systemd/system/postfix.service

dpkg -L postfix | grep service
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: reloading postfix with systemd

Matus UHLAR - fantomas
In reply to this post by Bastian Blank-3
On 10.08.17 20:06, Bastian Blank wrote:
>On Thu, Aug 10, 2017 at 05:42:44PM +0000, Fazzina, Angelo wrote:
>> 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.
>
>Well. "postfix reload" != "service postfix reload".

are you sure it doesn't just send SIGHUP to master process, with effectively
the same effect than "postfix reload"?
--
Matus UHLAR - fantomas, [hidden email] ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Quantum mechanics: The dreams stuff is made of.
Loading...