Re: Service startup delay

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Max Dunn <mdunn(at)xythos(dot)com>
Cc: "'Dave Page'" <dpage(at)vale-housing(dot)co(dot)uk>, "'Barry Lind'" <blind(at)xythos(dot)com>, pgsql-hackers-win32(at)postgresql(dot)org, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Service startup delay
Date: 2004-08-21 03:12:26
Message-ID: 200408210312.i7L3CQQ09755@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32 pgsql-patches


OK, I started running tests with pg_ctl -w and found it did not work
even on Unix. I found that the code was not checking the return value
of PQsetdbLogin(), and wasn't looping properly using a sleep.

The attached applied patch should fix should fix your reported problem.

---------------------------------------------------------------------------

Max Dunn wrote:
> I tried adding the "-w" option to the registry entry for starting the
> Postgres service(see below) but it didn't help; Tomcat still started before
> Postgres was ready:
>
> c:\Program Files\Xythos\WebFile Server Evaluation\pgsql\bin>sc qc postgresql
> [SC] GetServiceConfig SUCCESS
>
> SERVICE_NAME: postgresql
> TYPE : 10 WIN32_OWN_PROCESS
> START_TYPE : 2 AUTO_START
> ERROR_CONTROL : 1 NORMAL
> BINARY_PATH_NAME : C:/Program Files/Xythos/WebFile Server
> Evaluation/p
> gsql/bin/pg_ctl.exe runservice -w -N "PostgreSQL" -D "C:/Program
> Files/Xythos/We
> bFile Server Evaluation/pgsql/data" -o "-i"
> LOAD_ORDER_GROUP :
> TAG : 0
> DISPLAY_NAME : PostgreSQL
> DEPENDENCIES : RPCSS
> SERVICE_START_NAME : .\postgres
>
> --Max
>
> -----Original Message-----
> From: Dave Page [mailto:dpage(at)vale-housing(dot)co(dot)uk]
> Sent: Friday, August 20, 2004 4:09 PM
> To: Bruce Momjian; Barry Lind
> Cc: pgsql-hackers-win32(at)postgresql(dot)org; Max Dunn
> Subject: RE: [pgsql-hackers-win32] Service startup delay
>
>
>
> > -----Original Message-----
> > From: pgsql-hackers-win32-owner(at)postgresql(dot)org
> > [mailto:pgsql-hackers-win32-owner(at)postgresql(dot)org] On Behalf Of Bruce
> > Momjian
> > Sent: 20 August 2004 19:00
> > To: Barry Lind
> > Cc: pgsql-hackers-win32(at)postgresql(dot)org; Max Dunn
> > Subject: Re: [pgsql-hackers-win32] Service startup delay
> >
> >
> > I think you need to use 'pg_ctl -w' to wait for it to start.
> >
>
> Does -w work when starting in service mode? Aside from that, one possible
> problem with this is what happens if the database goes into recovery mode at
> startup. Whilst waiting for that to run, I would think it's possible that
> the service control manager would timeout waiting for the service to
> complete startup.
>
> Regards, Dave.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
> joining column's datatypes do not match
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 1018 bytes

In response to

Responses

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Justin Wyer 2004-08-21 10:10:44 Re: [BUGS] postgresql 8.0b1 Win32 observations
Previous Message Bruce Momjian 2004-08-21 02:59:49 Re: Service startup delay

Browse pgsql-patches by date

  From Date Subject
Next Message Serguei Mokhov 2004-08-21 20:53:22 Translation updates for 7.4/8.0: postgres-ru
Previous Message Bruce Momjian 2004-08-21 02:59:49 Re: Service startup delay