Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running
Дата
Msg-id AANLkTi=oUxVMeNs57movi0SPwzAWzDHA8XVQx9C3FitU@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
On Fri, Nov 12, 2010 at 17:47, Bruce Momjian <bruce@momjian.us> wrote:
> Tom Lane wrote:
>> Bruce Momjian <bruce@momjian.us> writes:
>> > Uh, I still cannot reproduce the failure:
>>
>> I would imagine you need -w option on the start.  The whole issue
>> here is whether start's wait-for-server-start code works.
>
> Thanks, I am now able to reproduce this.  I was able to get this to
> report the .pgpass problem:
>
>        $ psql postgres
>        psql: FATAL:  password authentication failed for user "postgres"
>        password retrieved from file "/u/postgres/.pgpass"
>
>        $ pg_ctl stop
>        waiting for server to shut down.... done
>        server stopped
>
>        $ pg_ctl -w -l /dev/null start
>        waiting for server to start....FATAL:  password authentication failed
>        for user "postgres"
>        password retrieved from file "/u/postgres/.pgpass"
>        .FATAL:  password authentication failed for user "postgres"
>        password retrieved from file "/u/postgres/.pgpass"
>        .FATAL:  password authentication failed for user "postgres"
>        password retrieved from file "/u/postgres/.pgpass"
>        .^C
>
> I basically report the connection error string if it starts with "FATAL:".
>
> I originally tried to check for an ERRCODE_INVALID_PASSWORD error field
> (see // comments), but it seems there is no way to access this, i.e.
> PQgetResult(conn) on a connection failure is always NULL.
>
> Anyway, perhaps FATAL is a better test because it will report any major
> failure, not just a .pgpass one.
>
> Patch attached.

Bad Bruce, using C++ comments like that :P And non-context diff ;)

Does this actually solve the *problem*, though? The problem is not
what is reported  on stdout/stderr, the problem is that the net result
is that the server is reported as not started (by the service control
manager) when it actually *is* started. In this case, stderr doesn't
even go anywhere. What happens if you *don't* Ctrl-C it?


--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


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

Предыдущее
От: Alexander Korotkov
Дата:
Сообщение: Re: Fix for seg picksplit function
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: Isn't HANDLE 64 bits on Win64?