Re: BUG #10330: pg_ctl does not correctly honor "DETACHED_PROCESS"

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: erica(dot)stine(at)mailinator(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #10330: pg_ctl does not correctly honor "DETACHED_PROCESS"
Date: 2014-05-15 19:15:31
Message-ID: 20140515191531.GI25053@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, May 15, 2014 at 03:46:20PM +0000, erica(dot)stine(at)mailinator(dot)com wrote:
> The following bug has been logged on the website:
>
> Bug reference: 10330
> Logged by: Erica Stine
> Email address: erica(dot)stine(at)mailinator(dot)com
> PostgreSQL version: 9.3.4
> Operating system: Windows 7 64-bit Ultimate
> Description:
>
> This executable:
>
> https://github.com/cubiclesoft/createprocess-windows
>
> Allows users to start processes in all sorts of ways that exceed the
> limitations of the 'start' command by exposing the full power of the
> CreateProcess() API to the command-line. The Apache web server, for
> instance, has the problem of starting a hung command prompt using 'start'.
> However, using the above tool and calling it with /f=DETACHED_PROCESS causes
> 'httpd.exe' to correctly and silently start in the background.
>
> 'pg_ctl.exe', on the other hand, does not honor DETACHED_PROCESS and
> proceeds to create a new console window. There doesn't appear to be an
> option to override this undesirable behavior. Trying to use 'postgres.exe'
> directly with DETACTHED_PROCESS (and using the stdin, stdout, stderr
> options) results in four brand new console windows. It looks like each
> 'postgres.exe' process gets its own console window.
>
> The fix for this is to NOT create a console window if it doesn't exist and
> pass DETACHED_PROCESS to new processes so that the OS isn't creating console
> windows either based on executable type. I'm not alone in wanting a
> detached startup. Those of us who want isolated installs want to run
> PostgreSQL in a portable apps style format, behind the scenes, without using
> the Windows Services host.

I know we work around it somehow in the script we use to start Postgres
as a Windows server. It would be nice to have these flags in the pg_ctl
executable, but none of our developers know how to write such code, or
at least I have not seen it.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Olivier Macchioni 2014-05-15 19:17:59 Re: BUG #10329: Could not read block 0 in file "base/56100265/57047884": read only 0 of 8192 bytes
Previous Message Tom Lane 2014-05-15 19:07:14 Re: BUG #10329: Could not read block 0 in file "base/56100265/57047884": read only 0 of 8192 bytes