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

2017-06-23 Thread Daniel Verite
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


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


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

2017-06-23 Thread Muhammad Hanif Abdul Hamid
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 is not 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.paqu...@gmail.com]
Sent: Jumaat, 23 Jun 2017 1:26 ptg
To: Tom Lane 
Cc: Muhammad Hanif Abdul Hamid ; 
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  wrote:
> Muhammad Hanif Abdul Hamid  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.

Yup, and the postmaster is designed to stop if it finds out that postmaster.pid 
is removed. See that:
commit: 7e2a18a9161fee7e67642863f72b51d77d3e996f
author: Tom Lane 
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 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.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


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

2017-06-22 Thread Michael Paquier
On Fri, Jun 23, 2017 at 1:43 PM, Tom Lane  wrote:
> Muhammad Hanif Abdul Hamid  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.

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


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


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

2017-06-22 Thread Tom Lane
Muhammad Hanif Abdul Hamid  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


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


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

2017-06-22 Thread Muhammad Hanif Abdul Hamid
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.