LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Postfix - Master is dead but pid file exists (https://www.linuxquestions.org/questions/linux-software-2/postfix-master-is-dead-but-pid-file-exists-851700/)

dlcomm 12-21-2010 08:46 PM

Postfix - Master is dead but pid file exists
 
When I check the status of postfix I get this error..... what does it mean and how do I fix / troubleshoot it?

kbp 12-21-2010 09:14 PM

- 'service postfix stop'
- 'service postfix start' .. if it doesn't start ok then manually delete the pid file first
- check the logs to determine the cause of 'master' dying

dlcomm 12-21-2010 09:29 PM

That's just it.... there are no log entries regarding postfix and I searched for a PID file and there are no postfix.pid files located anywhere on the server.... so wtf?

kbp 12-21-2010 09:31 PM

Try /var/spool/postfix/pid/master.pid

You may find error messages under /var/log/maillog or /var/log/messages

dlcomm 12-21-2010 09:54 PM

I searched both logs and found nothing.... rebooted the server after setting postfix to start with init 5 and this is what was added to the maillog

In addition, a test email i manually created to discover that yes out of the box creates an open relay, is still being rejected. I sent the email to joe@blow.com and go figure it actually attempted to send the dam email even though my mail from: address was just as corny. Ugh...


Dec 21 19:30:43 SERVER sendmail[2093]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA: cannot bind: Address already in use
Dec 21 19:30:43 SERVER sendmail[2093]: daemon MTA: problem creating SMTP socket
Dec 21 19:30:48 SERVER sendmail[2093]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA: cannot bind: Address already in use
Dec 21 19:30:48 SERVER sendmail[2093]: daemon MTA: problem creating SMTP socket
Dec 21 19:30:53 SERVER sendmail[2093]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA: cannot bind: Address already in use
Dec 21 19:30:53 SERVER sendmail[2093]: daemon MTA: problem creating SMTP socket
Dec 21 19:30:58 SERVER sendmail[2093]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA: cannot bind: Address already in use
Dec 21 19:30:58 SERVER sendmail[2093]: daemon MTA: problem creating SMTP socket
Dec 21 19:31:03 SERVER sendmail[2093]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA: cannot bind: Address already in use
Dec 21 19:31:03 SERVER sendmail[2093]: daemon MTA: problem creating SMTP socket
Dec 21 19:31:08 SERVER sendmail[2093]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA: cannot bind: Address already in use
Dec 21 19:31:08 SERVER sendmail[2093]: daemon MTA: problem creating SMTP socket
Dec 21 19:31:13 SERVER sendmail[2093]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA: cannot bind: Address already in use
Dec 21 19:31:13 SERVER sendmail[2093]: daemon MTA: problem creating SMTP socket
Dec 21 19:31:18 SERVER sendmail[2093]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA: cannot bind: Address already in use
Dec 21 19:31:18 SERVER sendmail[2093]: daemon MTA: problem creating SMTP socket
Dec 21 19:31:23 SERVER sendmail[2093]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA: cannot bind: Address already in use
Dec 21 19:31:23 SERVER sendmail[2093]: daemon MTA: problem creating SMTP socket
Dec 21 19:31:28 SERVER sendmail[2093]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA: cannot bind: Address already in use
Dec 21 19:31:28 SERVER sendmail[2093]: daemon MTA: problem creating SMTP socket
Dec 21 19:31:28 SERVER sendmail[2093]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA: server SMTP socket wedged: exiting

Below is my main.cf file... I XXXXXXXXXX'd out the actual domain name for privacy but the rest is exactly how it set... any ideas?


---------------------- main.cf ----------------------------

command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix

#default_privs = nobody
#myhostname = host.domain.tld
#myhostname = virtual.domain.tld
#mydomain = domain.tld
#myorigin = $myhostname
#myorigin = $mydomain

#inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
inet_protocols = all

#proxy_interfaces =
#proxy_interfaces = 1.2.3.4

#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,
# mail.$mydomain, www.$mydomain, ftp.$mydomain

#local_recipient_maps = unix:passwd.byname $alias_maps
#local_recipient_maps = proxy:unix:passwd.byname $alias_maps
#local_recipient_maps =

unknown_local_recipient_reject_code = 550

#mynetworks_style = class
#mynetworks_style = subnet
#mynetworks_style = host
#mynetworks = 168.100.189.0/28, 127.0.0.0/8
#mynetworks = $config_directory/mynetworks
#mynetworks = hash:/etc/postfix/network_table

#relay_domains = $mydestination
#relayhost = $mydomain
#relayhost = [gateway.my.domain]
#relayhost = [mailserver.isp.tld]
#relayhost = uucphost
#relayhost = [an.ip.add.ress]
#relay_recipient_maps = hash:/etc/postfix/relay_recipients

#in_flow_delay = 1s

#alias_maps = dbm:/etc/aliases
alias_maps = hash:/etc/aliases
#alias_maps = hash:/etc/aliases, nis:mail.aliases
#alias_maps = netinfo:/aliases
#alias_database = dbm:/etc/aliases
#alias_database = dbm:/etc/mail/aliases
alias_database = hash:/etc/aliases
#alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases

#recipient_delimiter = +


#home_mailbox = Mailbox
#home_mailbox = Maildir/


#mail_spool_directory = /var/mail
#mail_spool_directory = /var/spool/mail

#mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
# mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
#
# local_destination_recipient_limit = 300
# local_destination_concurrency_limit = 5
#
#mailbox_transport = cyrus

#fallback_transport =

#luser_relay = $local@other.host
#luser_relay = admin+$local

#header_checks = regexp:/etc/postfix/header_checks

#fast_flush_domains = $relay_domains

#smtpd_banner = $myhostname ESMTP $mail_name
#smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)


#local_destination_concurrency_limit = 2
#default_destination_concurrency_limit = 20

debug_peer_level = 2

#debug_peer_list = 127.0.0.1
#debug_peer_list = some.domain

debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail.postfix

newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix

setgid_group = postdrop

html_directory = no

manpage_directory = /usr/share/man

sample_directory = /usr/share/doc/postfix-2.7.1/samples

readme_directory = /usr/share/doc/postfix-2.7.1/README_FILES
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination permit_inet_interfaces reject_unknown_reverse_client_hostname permit_sasl_authenticated
smtpd_client_restrictions = permit_mynetworks permit_inet_interfaces reject_unknown_reverse_client_hostname permit_tls_all_clientcerts
myhostname = mail.XXXXXXXXXX.com
mydestination = XXXXXXXXX.com
mydomain = mail.XXXXXXXXX.com
myorigin = XXXXXXXXXX.com

dlcomm 12-21-2010 10:15 PM

Okay..... and more strangeness.... I was doing something else on the server and in order to test it, I had to reboot again.... I got a message in my inbox and checked..... master is now working just fine..... hmmmmph strange issue....

kbp 12-21-2010 10:20 PM

Actually out of the box postfix will only relay mail for itself... have the sendmail messages cleared up in the logs ?

dlcomm 12-21-2010 10:27 PM

Yes... it appears so and a new entry was created telling me the aliases database was rebuilt
So far so good!!!!

Now... with my config file.... can you see any reason why I cant access the smtp port (25) from anywhere other then localhost?
I created at firewall exception to open the port but even from within my LAN I can not connect to the smtp server portion. Am I missing something????

kbp 12-21-2010 10:42 PM

Maybe "inet_protocols = all" was meant to be "inet_interfaces = all" ... ? .. this tells postfix to listen on all interfaces

dlcomm 12-21-2010 11:40 PM

Yup.... that was part of it.... Now to figure out why its going to my internal mail and not showing up in my postfix box... but that is another post if I don't figure it out. Thanks for your help!

voon 04-05-2013 08:09 PM

Ok, I know this thread is old already but Googling "Postfix - Master is dead but pid file exists" leads to nowhere but only here. So I just would like to share my solution here for others who desperate seeking for solution.

I'll start by describing my problem of "Master is dead but pid file exists".
  • I've tried restarting the service (sudo service postfix restart) but I'm keep getting the same error.
    Code:

    # service postfix status
    master dead but pid file exists

  • Removing /var/spool/postfix/pid/master.pid and /var/lock/subsys/postfix still won't solve the problem.
  • Re-checking all settings in /etc/postfix/main.cf still don't give a clue because I'm using default settings.
  • Even changing owner by using chown postfix:postfix -R /etc/postfix won't solve, as postfix even complain the file must
    be own by root

At the end I re-examine /var/log/maillog properly I found out the line in the log:
Code:

postfix/master[7240]: fatal: bind 127.0.0.1 port 25: Address already in use
Out of curiosity who is using port 25, I run the commands below:

Code:

# service postfix stop
# netstat -an | grep 25
tcp        0      0 127.0.0.1:25                0.0.0.0:*                  LISTEN

Suspecting it was used by sendmail (because sendmail come with default installation of the distro I use), I further tried:

Code:

# ps aux | grep sendmail
root      4585  0.0  0.4  86820  2624 ?        Ss  Apr05  0:00 sendmail: accepting connections
smmsp    4592  0.0  0.3  78288  2012 ?        Ss  Apr05  0:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
root      7338  0.0  0.1 103424  836 pts/0    S+  00:41  0:00 grep sendmail

I was right, therefore I run this:

Code:

# yum remove sendmail
And to verify:

Code:

# service postfix start
Starting postfix:                                          [  OK  ]

# service postfix status
master (pid  7455) is running...

Woots! postfix is running fine now! :)


All times are GMT -5. The time now is 07:15 AM.