![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I just played around with external_pid_file in 8.1.4. I noticed that the file is created and filled properly, but it is not removed again when the server is stopped. Looking at the code I see this comment in |

#3
| |||
| |||
|
|
Martin Pitt wrote: I just played around with external_pid_file in 8.1.4. I noticed that the file is created and filled properly, but it is not removed again when the server is stopped. Looking at the code I see this comment in src/backend/postmaster/postmaster.c /* Should we remove the pid file on postmaster exit? */ IMHO, yes. It's not useful anymore. |
#4
| |||
| |||
|
|
Euler Taveira de Oliveira <euler (AT) timbira (DOT) com> writes: Martin Pitt wrote: I just played around with external_pid_file in 8.1.4. I noticed that the file is created and filled properly, but it is not removed again when the server is stopped. Looking at the code I see this comment in src/backend/postmaster/postmaster.c /* Should we remove the pid file on postmaster exit? */ IMHO, yes. It's not useful anymore. [ shrug... ] If the postmaster crashes, it would certainly fail to remove the pidfile. So I'd argue that your unnamed external script that is expecting the pidfile to go away needs work: if it's not verifying the PID given in the file, it's broken. |
#5
| |||
| |||
|
|
Doesn't removing the file reduce the chances of failing to start later in case another postmaster already has that pid? |
#6
| |||
| |||
|
|
Bruce Momjian <pgman (AT) candle (DOT) pha.pa.us> writes: Doesn't removing the file reduce the chances of failing to start later in case another postmaster already has that pid? No, because the external pidfile has zero to do with Postgres' internal behavior. Personally I always thought that the external pidfile was a "feature" we should have rejected. It can never be a particularly reliable guide to what PG is doing, the more especially so if the program looking at it isn't doing any cross-checking, as the OP seems not to be doing. |
#7
| |||
| |||
|
|
Bruce Momjian <pgman (AT) candle (DOT) pha.pa.us> writes: Doesn't removing the file reduce the chances of failing to start later in case another postmaster already has that pid? No, because the external pidfile has zero to do with Postgres' internal behavior. Personally I always thought that the external pidfile was a "feature" we should have rejected. It can never be a particularly reliable guide to what PG is doing, the more especially so if the program looking at it isn't doing any cross-checking, as the OP seems not to be doing. |
#8
| |||
| |||
|
|
No, because the external pidfile has zero to do with Postgres' internal behavior. +1. So we have two options: have external_pid_file mimics the internal |
![]() |
| Thread Tools | |
| Display Modes | |
| |