pgsql: Windows: Make pg_ctl reliably detect service status - Mailing list pgsql-committers

From Alvaro Herrera
Subject pgsql: Windows: Make pg_ctl reliably detect service status
Date
Msg-id E1aHC4K-00057b-Mo@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Windows: Make pg_ctl reliably detect service status

pg_ctl is using isatty() to verify whether the process is running in a
terminal, and if not it sends its output to Windows' Event Log ... which
does the wrong thing when the output has been redirected to a pipe, as
reported in bug #13592.

To fix, make pg_ctl use the code we already have to detect service-ness:
in the master branch, move src/backend/port/win32/security.c to src/port
(with suitable tweaks so that it runs properly in backend and frontend
environments); pg_ctl already has access to pgport so it Just Works.  In
older branches, that's likely to cause trouble, so instead duplicate the
required code in pg_ctl.c.

Author: Michael Paquier
Bug report and diagnosis: Egon Kocjan
Backpatch: all supported branches

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/b96f6f4443fcc68336c7ed45e470c577a4891c00

Modified Files
--------------
src/bin/pg_ctl/pg_ctl.c |  160 ++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 159 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: In initdb's post-bootstrap phase, drop temp tables explicitly.
Next
From: Alvaro Herrera
Date:
Subject: pgsql: Windows: Make pg_ctl reliably detect service status