Safest way to restart a CentOs postfix server without systemctl

3 posts / 0 new
Last post
#1 Wed, 06/14/2017 - 03:14
konamacphee
konamacphee's picture

Safest way to restart a CentOs postfix server without systemctl

Hi all,

I'm using Webmin 1.831, Virtualmin 5.07, with Authentic theme 18.49-7 on Centos 7.

My postfix server is currently (accidentally) running outside of the Webmin / systemctl framework.
The webmin gui shows it as not running, and systemctl reports it as failed:

~ $ systemctl status postfix.service
● postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2017-02-13 13:06:29 GMT; 3 months 29 days ago
Main PID: 1670 (code=exited, status=1/FAILURE)

However, postfix is actually up and running (and working properly):

~ $ ps -ef |grep postfix
postfix  23136 26216  0 08:04 ?        00:00:00 pickup -l -t unix -u
postfix  25634 26216  0 03:45 ?        00:00:00 anvil -l -t unix -u
root     26216     1  0 Jan03 ?        00:09:46 /usr/libexec/postfix/master -w
postfix  27052 26216  0 08:28 ?        00:00:00 smtpd -n smtp -t inet -u -o stress= -s 2 -o smtpd_sasl_auth_enable=yes
postfix  27684 26216  0 Feb13 ?        00:04:17 qmgr -l -t unix -u
postfix  27700 26216  0 Feb13 ?        00:00:17 tlsmgr -l -t unix -u
postfix  28718 26216  0 08:43 ?        00:00:00 trivial-rewrite -n rewrite -t unix -u
postfix  29662 26216  0 08:50 ?        00:00:00 cleanup -z -t unix -u
postfix  30221 26216  0 08:55 ?        00:00:00 local -t unix
postfix  30222 26216  0 08:55 ?        00:00:00 local -t unix
postfix  31530 26216  0 09:02 ?        00:00:00 cleanup -z -t unix -u
postfix  31534 26216  0 09:02 ?        00:00:00 local -t unix
postfix  32695 26216  0 09:08 ?        00:00:00 smtpd -n smtp -t inet -u -o stress= -s 2 -o smtpd_sasl_auth_enable=yes
postfix  32696 26216  0 09:08 ?        00:00:00 proxymap -t unix -u

From here, what is the safest way to stop this existing postfix daemon (without loss of mail / danger of leaving stray lock files etc) so I can restart it properly using systemctl? I'd prefer not to reboot the server if I don't have to.

Cheers!

Wed, 06/14/2017 - 12:03
Diabolico
Diabolico's picture

Try with systemctl unmask ######. About what is the safest way to restart postfix, use reload instead of restart, Either way you should focus on repairing your postfix and then the rest.

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Sun, 06/18/2017 - 04:15
konamacphee
konamacphee's picture

Thanks diabolico - weird thing was there was actually nothing wrong with the postfix config.

Postfix was running outside systemctl, but even "/sbin/postfix status" claimed that it wasn't running (so I couldn't use "/sbin/postfix stop|reload" to stop or reload it.) "/sbin/postfix check" didn't report config errors.

In the end I rebooted the server and once again it came up with postfix running but outside systemctl (i.e. webmin still reported it as stopped.) This time, however, "/sbin/postfix status" recognised the running instance, so I could stop it using "/sbin/postfix stop". Having done that, I could then restart it using systemctl and now things are back to normal - postfix came up normally via systemctl after a second reboot.

Topic locked