Theresa Arzadon-Labajo

Postfix master dead but pid file exists

Posted by Theresa Arzadon-Labajo (tarzadon) on Mar 06 2014
Tech Stuff >> Unix-Linux
Puppet logs showed:
puppet-agent[16302]: (/Stage[main]/Mail::Postfix/Service[postfix]/ensure) change from stopped to running failed: Could not start Service[postfix]: Execution of '/sbin/service postfix start' returned 1:  at /etc/puppet/modules/mail/manifests/postfix.pp:8

Status showed:
# service postfix status
master dead but pid file exists

Stop and start:
# service postfix stop
# service postfix status
master dead but pid file exists

Remove pid and lock files:
# \rm  /var/spool/postfix/pid/master.pid
# \rm /var/lock/subsys/postfix
# service postfix stop
# service postfix start
Starting postfix:                                          [  OK  ]
# service postfix status
master dead but pid file exists

I checked the status of the postfix process on my other workstations and servers and they were all dead.
yum.log showed that postfix was recently updated:
Feb 22 04:47:23 Updated: 2:postfix-2.6.6-6.el6_5.x86_64

Another log showed:
postfix/master[1490]: fatal: open lock file /var/lib/postfix/master.lock: unable to set exclusive lock: Resource temporarily unavailable

# ls -l /var/lib/postfix/master.lock
-rw------- 1 postfix postfix 17 Feb  7 11:08 /var/lib/postfix/master.lock
# fuser /var/lib/postfix/master.lock
/var/lib/postfix/master.lock: 15590
# ps -ef | grep 15590
root     15590  0.0  0.0  6624 1868 ?        Ss   Feb07   0:33    /usr/libexec/postfix/master
Kill the process that is accessing the master.lock file:
# fuser -k /var/lib/postfix/master.lock
Stop postfix, remove pid and lock file, kill the process accessing master.lock, restart postfix:
Starting postfix: [  OK  ]
master (pid  18179) is running...

Ran a script on the rest of my workstations and servers:

sudo service postfix stop; sudo \rm  /var/lock/subsys/postfix; sudo \rm /var/spool/postfix/pid/master.pid; sudo fuser -k /var/lib/postfix/master.lock;sleep 5;sudo service postfix start;sleep 5; sudo service postifix status

Last changed: Feb 27 2020 at 4:02 PM

Back