Обсуждение: Re: Postgres not starting at boot(FreeBSD) - startup script not releasing < solved

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

Re: Postgres not starting at boot(FreeBSD) - startup script not releasing < solved

От
"Dave"
Дата:
Bingo!  Dumb move.  Dropped everything to password a few months back,  never had
the occasion to restart after that.  Will work on tweaking the pg_hba.conf

Thanks Matthew...  if you are ever in Toronto, I owe you a beer.

Dave

>At a guess, you've set it up to not automatically trust local users, so
>the default options which 'wait' for the server to come up (and "waits"
>by having psql try connecting as the postgres user) waits for a long long
>time for somebody to give it the password it now requires.
>
>I find that rather annoying, and miss it every time, until the rc script
>hangs.  Check the options and figure out which one it is you have to take
>out, I can't recall offhand.
>
>
>
>--
>Matthew Fuller     (MF4839)     |    fullermd@over-yonder.net
>Unix Systems Administrator      |    fullermd@futuresouth.com
>Specializing in FreeBSD         |    http://www.over-yonder.net/
>


Re: [ADMIN] Postgres not starting at boot(FreeBSD) - startup script not releasing < solved

От
"Matthew D. Fuller"
Дата:
On Sun, Mar 10, 2002 at 06:11:21PM -0500 I heard the voice of
Dave, and lo! it spake thus:
> Bingo!  Dumb move.  Dropped everything to password a few months back,  never had
> the occasion to restart after that.  Will work on tweaking the pg_hba.conf

FWIW (after a quick glance at the default script and the manpage), "-w"
is the pg_ctl option that makes it wait.  I just take it out; it only
takes PG a few seconds to initialize, so it's ready to go long before
something would need to connect to it.

It could also be said that having -w implemented as invoking psql to try
to connect as the DB superuser assuming no password is a rather
inappropriate way of going about it, but that's another can of worms.



--
Matthew Fuller     (MF4839)     |    fullermd@over-yonder.net
Unix Systems Administrator      |    fullermd@futuresouth.com
Specializing in FreeBSD         |    http://www.over-yonder.net/

"The only reason I'm burning my candle at both ends, is because I
      haven't figured out how to light the middle yet"

Re: [ADMIN] Postgres not starting at boot(FreeBSD) - startup

От
"Chad R. Larson"
Дата:
At 02:54 AM 3/11/2002 , Matthew D. Fuller wrote:
>It could also be said that having -w implemented as invoking psql to try
>to connect as the DB superuser assuming no password is a rather
>inappropriate way of going about it, but that's another can of worms.

It doesn't wait for the PID file to be created (at least, no on our 7.1.2
systems).  It attempts to connect to a database using psql, and loops until
that connection is successful.  Which it won't be if you've got a
password,  because the script will wait for some entity to type the
password, and hang.

My fix here was a hack in pg_ctl, right at the bottom where the script is
looping on a psql attempt to connect to a database to prove the system is
up.  I added a "-h localhost" to the psql invocation to force a TCP
connection, and then used "ident" instead of password for the authorization.


         -crl
--
Chad R. Larson (CRL22)    chad@eldocomp.com
   Eldorado Computing, Inc.   602-604-3100
      5353 North 16th Street, Suite 400
        Phoenix, Arizona  85016-3228