Thread: postmaster.pid
PG_VERSION: 9.1.9
Arch: x86_64
OS: CentOS 6.5
We have a config-only setup (postgresql.conf exists not in $PGDATA). In postgresql.conf, external_pid_file is set and creates postmaster.pid in $PGDATA. Issuing “pg_ctl start”, the contents of postmaster.pid only ever contains one line, the process ID. It never contains any other lines, but according to specs, it’s supposed to have 7 lines. Any idea why postmaster.pid is only containing a single line, the process ID and no other lines?
"Herr, Christian" <cherr@vt.edu> writes: > We have a config-only setup (postgresql.conf exists not in $PGDATA). In postgresql.conf, external_pid_file is set andcreates postmaster.pid in $PGDATA. Issuing "pg_ctl start", the contents of postmaster.pid only ever contains one line,the process ID. It never contains any other lines, but according to specs, it's supposed to have 7 lines. Any ideawhy postmaster.pid is only containing a single line, the process ID and no other lines? Only the "real" pid file (the one in the data directory) has extra lines. A file created for external_pid_file contains the PID and nothing more. If you specified external_pid_file as pointing to the data directory, then you broke things badly. Do not do that. regards, tom lane
Thanks, you pointed out exactly what the problem was. postgresql.conf had external_pid_file set to write to $PGDATA/postmaster.pid,which was overwriting the "real" postmaster.pid with only a single line. Maybe this was a configurationholdover from an older version, since the comment above this setting was: " # If external_pid_file is not explicitlyset, no extra PID file is written." -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Sent: Friday, April 11, 2014 9:52 AM To: Herr, Christian Cc: pgsql-novice@postgresql.org Subject: Re: [NOVICE] postmaster.pid "Herr, Christian" <cherr@vt.edu> writes: > We have a config-only setup (postgresql.conf exists not in $PGDATA). In postgresql.conf, external_pid_file is set andcreates postmaster.pid in $PGDATA. Issuing "pg_ctl start", the contents of postmaster.pid only ever contains one line,the process ID. It never contains any other lines, but according to specs, it's supposed to have 7 lines. Any ideawhy postmaster.pid is only containing a single line, the process ID and no other lines? Only the "real" pid file (the one in the data directory) has extra lines. A file created for external_pid_file contains the PID and nothing more. If you specified external_pid_file as pointing to the data directory, then you broke things badly. Do not do that. regards, tom lane