Re: Bug with pg_ctl -w/wait and config-only directories

Поиск
Список
Период
Сортировка
От Mr. Aaron W. Swenson
Тема Re: Bug with pg_ctl -w/wait and config-only directories
Дата
Msg-id 20111005235304.GB19405@atrus.grandmasfridge.org
обсуждение исходный текст
Ответ на Re: Bug with pg_ctl -w/wait and config-only directories  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: Bug with pg_ctl -w/wait and config-only directories
Список pgsql-hackers
On Wed, Oct 05, 2011 at 07:20:16PM -0400, Bruce Momjian wrote:
> Mr. Aaron W. Swenson wrote:
> -- Start of PGP signed section.
> > On Wed, Oct 05, 2011 at 10:44:38AM -0400, Bruce Momjian wrote:
> > > Peter Eisentraut wrote:
> > > > On m?n, 2011-10-03 at 15:09 -0400, Bruce Momjian wrote:
> > > > > Why were people not using pg_ctl?
> > > >
> > > > Actually, a slight correction/addition here: The Debian init script does
> > > > use pg_ctl to start the service.  Seems to work fine.
> > >
> > > Yes.  The script authors discovered a working behavior, which matches my
> > > research:
> > >
> > >         pg_ctl start            specify config directory
> > >         pg_ctl -w start         impossible
> > > ...
> >
> >
> > Maybe I'm misunderstanding what you've written, but for 'pg_ctl -w' it is
> > possible. The following command does work (I've replaced the variables
> > with their default values to make it easier to read):
> >
> >   su -l postgres \
> >     -c "env PGPORT=\"5432\" /usr/lib/postgresql-9.1/bin/pg_ctl start -w \
> >         -t 60 -s -D /var/lib/postgresql/9.1/data/ \
> >          -o '-D /etc/postgresql-9.1/ \
> >             --data-directory=/var/lib/postgresql/9.1/data/ \
> >             --silent-mode=true'"
>
> Wow.  So you are telling pg_ctl to use the real data directory, but are
> passing flags to the postmaster to start with the config directory and
> also setting data-directory to the real data directory.  I am impressed.
>
> I can see how that would work.  Did you look at the C code to figure
> this out or did you just test until it worked, or did it just seem
> logical to you?

No, I didn't look into the C code. (Though, I have poked around in there a
bit.)

Being a Gentoo user has taught me a few things like one should always
'read the friendly manual.' It just seemed logical after reading the
pg_ctl documentation that passing options to the postmaster would do the
trick, which spurred my testing several variations until it worked. But, I
only knew that I could give 'postgres'/'postmaster' the configuration
directory and it would do the right thing.
> With the patch I am going to commit, you will not need to use one of the
> -D flags because pg_ctl will find the data directory location;  you will
> just specify the config-only directory with one -D, and the
> --data-directory.

So, you're saying that my passing the config directory to pg_ctl through
'-D' will eliminate the need -- as far as config and data directories are
concerned -- to pass options directly to the postmaster?

--
Mr. Aaron W. Swenson
Gentoo Linux Developer
Email    : titanofold@gentoo.org
GnuPG FP : 2C00 7719 4F85 FB07 A49C  0E31 5713 AA03 D1BB FDA0
GnuPG ID : D1BBFDA0

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Bug with pg_ctl -w/wait and config-only directories
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Bug with pg_ctl -w/wait and config-only directories