Thread: [GENERAL] Suddenly - LOG: could not open file "postmaster.pid": No such fileor directory

[GENERAL] Suddenly - LOG: could not open file "postmaster.pid": No such fileor directory

From
Muhammad Hanif Abdul Hamid
Date:

Hi,

 

Within this week, I have faced two times “postmaster.pid” went missing in a sudden. Nobody deleted it or shutdown the server.

 

May I know anybody who has ever experience this?


Can please anybody can help me on this?

 

2017-06-20 13:10:10.261 MYT [24726] [unknown]@[unknown] LOG:  incomplete startup packet

2017-06-20 13:15:10.215 MYT [24895] [unknown]@[unknown] LOG:  incomplete startup packet

2017-06-20 13:19:03.757 MYT [2454] LOG:  could not open file "postmaster.pid": No such file or directory

2017-06-20 13:19:03.757 MYT [2454] LOG:  performing immediate shutdown because data directory lock file is invalid

2017-06-20 13:19:03.757 MYT [2454] LOG:  received immediate shutdown request

.

.

.

2017-06-23 11:15:14.192 MYT [5375] [unknown]@[unknown] LOG:  incomplete startup packet

2017-06-23 11:20:14.154 MYT [5592] [unknown]@[unknown] LOG:  incomplete startup packet

2017-06-23 11:20:34.465 MYT [2696] LOG:  could not open file "postmaster.pid": No such file or directory

2017-06-23 11:20:34.465 MYT [2696] LOG:  performing immediate shutdown because data directory lock file is invalid

2017-06-23 11:20:34.465 MYT [2696] LOG:  received immediate shutdown request

 

Thank you.



DISCLAIMER:

This e-mail (including any attachments) is for the addressee(s) only and may be confidential, especially as regards personal data. If you are not the intended recipient, please note that any dealing, review, distribution, printing, copying or use of this e-mail is strictly prohibited. If you have received this email in error, please notify the sender immediately and delete the original message (including any attachments).

MIMOS Berhad is a research and development institution under the purview of the Malaysian Ministry of Science, Technology and Innovation. Opinions, conclusions and other information in this e-mail that do not relate to the official business of MIMOS Berhad and/or its subsidiaries shall be understood as neither given nor endorsed by MIMOS Berhad and/or its subsidiaries and neither MIMOS Berhad nor its subsidiaries accepts responsibility for the same. All liability arising from or in connection with computer viruses and/or corrupted e-mails is excluded to the fullest extent permitted by law.

Muhammad Hanif Abdul Hamid <hanif.hamid@mimos.my> writes:
> Within this week, I have faced two times "postmaster.pid" went missing in a sudden. Nobody deleted it or shutdown the
server.

I'd lay very long odds that your second statement is false.  *Something*
removed that file, and it wasn't the postmaster.

            regards, tom lane


On Fri, Jun 23, 2017 at 1:43 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Muhammad Hanif Abdul Hamid <hanif.hamid@mimos.my> writes:
>> Within this week, I have faced two times "postmaster.pid" went missing in a sudden. Nobody deleted it or shutdown
theserver. 
>
> I'd lay very long odds that your second statement is false.  *Something*
> removed that file, and it wasn't the postmaster.

Yup, and the postmaster is designed to stop if it finds out that
postmaster.pid is removed. See that:
commit: 7e2a18a9161fee7e67642863f72b51d77d3e996f
author: Tom Lane <tgl@sss.pgh.pa.us>
date: Tue, 6 Oct 2015 17:15:52 -0400
Perform an immediate shutdown if the postmaster.pid file is removed
--
Michael


Re: [GENERAL] Suddenly - LOG: could not open file "postmaster.pid":No such file or directory

From
Muhammad Hanif Abdul Hamid
Date:
Hi,

Thanks for your reply, Tom and Michael.

Maybe an irrelevant question, but I would like to know if there anything from postgres process (e.g any parameter that
isnot set right) that might remove the postmaster.pid?
 

FYI, we have 20 other sites with the same database use but have not experienced this problem.

Thank you.

-----Original Message-----
From: Michael Paquier [mailto:michael.paquier@gmail.com]
Sent: Jumaat, 23 Jun 2017 1:26 ptg
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Muhammad Hanif Abdul Hamid <hanif.hamid@mimos.my>; pgsql-general@postgresql.org
Subject: Re: [GENERAL] Suddenly - LOG: could not open file "postmaster.pid": No such file or directory

On Fri, Jun 23, 2017 at 1:43 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Muhammad Hanif Abdul Hamid <hanif.hamid@mimos.my> writes:
>> Within this week, I have faced two times "postmaster.pid" went missing in a sudden. Nobody deleted it or shutdown
theserver.
 
>
> I'd lay very long odds that your second statement is false.
> *Something* removed that file, and it wasn't the postmaster.

Yup, and the postmaster is designed to stop if it finds out that postmaster.pid is removed. See that:
commit: 7e2a18a9161fee7e67642863f72b51d77d3e996f
author: Tom Lane <tgl@sss.pgh.pa.us>
date: Tue, 6 Oct 2015 17:15:52 -0400
Perform an immediate shutdown if the postmaster.pid file is removed
--
Michael

________________________________
DISCLAIMER:


This e-mail (including any attachments) is for the addressee(s) only and may be confidential, especially as regards
personaldata. If you are not the intended recipient, please note that any dealing, review, distribution, printing,
copyingor use of this e-mail is strictly prohibited. If you have received this email in error, please notify the sender
immediatelyand delete the original message (including any attachments).
 

MIMOS Berhad is a research and development institution under the purview of the Malaysian Ministry of Science,
Technologyand Innovation. Opinions, conclusions and other information in this e-mail that do not relate to the official
businessof MIMOS Berhad and/or its subsidiaries shall be understood as neither given nor endorsed by MIMOS Berhad
and/orits subsidiaries and neither MIMOS Berhad nor its subsidiaries accepts responsibility for the same. All liability
arisingfrom or in connection with computer viruses and/or corrupted e-mails is excluded to the fullest extent permitted
bylaw.
 

    Muhammad Hanif Abdul Hamid wrote:

> Maybe an irrelevant question, but I would like to know if there anything
> from postgres process (e.g any parameter that is not set right) that might
> remove the postmaster.pid?

If using Linux, you may put it under watch with

# auditctl -w /path/to/postmaster.pid  -k pgpid

If that records too many events, it can be filtered further, for
example this should catch only deletions:

# auditctl -a exit,always -F path=/path/to/postmaster.pid \
    -F arch=b64 -S unlink -S unlinkat -k pgpid

Once in effect, the records about which process/user/command
deletes the file and when would be obtained with:

# ausearch -k pgpid


Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite