Обсуждение: BUG #2432: PID file not created if $PGDATA is different from Datadir

Поиск
Список
Период
Сортировка

BUG #2432: PID file not created if $PGDATA is different from Datadir

От
"Thomas Reiss"
Дата:
The following bug has been logged online:

Bug reference:      2432
Logged by:          Thomas Reiss
Email address:      thomas.reiss@interieur.gouv.fr
PostgreSQL version: 8.1.3
Operating system:   Linux Debian sarge
Description:        PID file not created if $PGDATA is different from
Datadir
Details:

Hello,


I'm experiencing the data_directory parameter in order to differenciate the
config files from the data files.
I did the following:
- use an existing PG cluster
- moved the *.conf to a specific config directory
- changed my $PGDATA to the config directory
- changed the data_directory parameter to point to the appropriate directory
(the old PGDATA in fact)
- started PostgreSQL, everything is fine

When I tried to shutdown PG with a simple pg_ctl stop, the tool claimed
about a missing postmaster.pid file. pg_ctl status didn't worked either.
When looking into the $PGDATA dir, I only had my 3 config file and no
postmaster.pid.
I then shut down PG by sending a kill signal by hand.

I then tried the external_pid_file parameter and pointed it to
$PGDATA/postmaster.pid (I gave the real pathname in the config file of
course).
PG started well. Now, pg_ctl stop don't complain anymore about the pid file,
but goes in an infinite loop, probably waiting the postmaster.pid file to be
deleted.

Thanks in advance for providing an advice.
Thomas

Re: BUG #2432: PID file not created if $PGDATA is different from Datadir

От
Tom Lane
Дата:
"Thomas Reiss" <thomas.reiss@interieur.gouv.fr> writes:
> The following bug has been logged online:
> Description:        PID file not created if $PGDATA is different from
> Datadir

Yes it is, but it's in the data_directory.  In general the postmaster
need not (and probably should not) have write permission where the
configure files are, so we're not going to be changing this.

> When I tried to shutdown PG with a simple pg_ctl stop, the tool claimed
> about a missing postmaster.pid file. pg_ctl status didn't worked either.

pg_ctl hasn't been taught to parse the config file to find out where
data_directory is, so it really doesn't work with this layout yet.
Sorry.

            regards, tom lane