Skip site navigation (1) Skip section navigation (2)

Problems with "-w" option on pg_ctl.exe running as a windows service

From: "Steve McWilliams" <smcwilliams(at)EmprisaNetworks(dot)com>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: Problems with "-w" option on pg_ctl.exe running as a windows service
Date: 2004-12-21 16:43:06
Message-ID: 3066.10.1.1.142.1103647386.squirrel@wwws.emprisanetworks.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-patches
Hello,

I tried sending this the other week but for some reason it hasn't gone
through, so I am resending:

I am using Postgresql-8.0.0beta4 on Windows XP Pro and have noticed that
attempts to run pg_ctl as a service fail when the "-w" option is included.
 So if I register the service as follows:

pg_ctl.exe -N my_svc -w -U my_user -P my_pword -D my_dir -o "-i -p 15432"

then try to start the service via the GUI service manager panel, it pops
up an error dialog saying the service started but then stopped
immediately.  If I remove the "-w" option from the above line when it is
registered, then I am able to start the service just file.

The usage documentation for pg_ctl indicates you are supposed to be able
to include the "-w" option when you register it as a service.  I would
like to be able to use it, so that when Windows launches postgres, it is
not declared to be in the fully running state prematurely.  We have
another service that we launch which declares a dependency on postgres,
however that dependency declaration is meaningless if postgres announces
that it is fully running before it is truly able to accept clients.

Any suggestions?  For a temporary work around I have hacked my pg_ctl.c to
wait 5 seconds before declaring the service to be in the running state. 
Thanks in advance.

Steve McWilliams



Responses

pgsql-bugs by date

Next:From: j6mDate: 2004-12-21 17:30:49
Subject: Polymorphism resgression test fails when BLCKSZ changed
Previous:From: Steve McWilliamsDate: 2004-12-21 16:28:18
Subject: "pg_ctl -w" does not return a failure exit code when postmaster fails to start

pgsql-patches by date

Next:From: Bruce MomjianDate: 2004-12-21 17:38:55
Subject: Re: [BUGS] "pg_ctl -w" does not return a failure exit code when postmaster
Previous:From: Steve McWilliamsDate: 2004-12-21 16:28:18
Subject: "pg_ctl -w" does not return a failure exit code when postmaster fails to start

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group