Re: BUG #13594: pg_ctl.exe redirects stderr to Windows Events Log if stderr is redirected to pipe

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Egon Kocjan <ekocjan(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13594: pg_ctl.exe redirects stderr to Windows Events Log if stderr is redirected to pipe
Date: 2016-01-08 14:55:35
Message-ID: 20160108145535.GA580550@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Andrew Dunstan wrote:

> On 01/08/2016 02:11 AM, Michael Paquier wrote:

> >Looking at the logs, the main difference is that win32security.c is
> >not compiled in -lpgport for cygwin, and cygwin goes through
> >src/include/port/win32.h to refer to some routines, so I would think
> >that the correct fix is to add win32security.c to the list of OBJS for
> >cygwin. So the attached is correct perhaps? That's a blind fix I don't
> >have cygwin set up on my machines now.

> I'll test it when I get a moment. Thanks for the patch.
>
> I see this service code goes back probably to the first commit of pg_ctl.c,
> which means it's going to have been either my fault or Bruce's :-)

Per IM conversation with Andrew, I pushed it blind and he'll set up an
immediate BF run on brolga so we know quickly whether it worked.

> TBH I'm not sure how to run postgres as a service on Cygwin. In
> general I would expect it to be via cygrunsrv, like other services I
> do actually run (cron and cygserver), rather than via pg_ctl. Anyway,
> for now lets see if we can get it building again.

Yeah, I guess you'd normally you'd do that, but the point is that the OP
was using pg_ctl to control one that's *not* a service and the logs were
still sent to Event Log because of the bug fixed here.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message chriscox 2016-01-08 21:16:02 BUG #13857: Processes display old Beta2 name in ps
Previous Message Andrew Dunstan 2016-01-08 14:16:43 Re: BUG #13594: pg_ctl.exe redirects stderr to Windows Events Log if stderr is redirected to pipe