Re: CI/windows docker vs "am a service" autodetection on windows

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Michael Paquier <michael(at)paquier(dot)xyz>, Dave Page <dpage(at)pgadmin(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
Subject: Re: CI/windows docker vs "am a service" autodetection on windows
Date: 2021-03-04 21:04:03
Message-ID: 20210304210403.GA20642@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2021-Mar-04, Andres Freund wrote:

> > > There does seem to be isatty(), so we could improve the case of
> > > pg_ctl/postgres run interactively without breaking a sweat. And there is
> > > fstat() too, so if stderr in a service is something distinguishable...
> >
> > We seem to have used that at some point, but commit
> > a967613911f7ef7b6387b9e8718f0ab8f0c4d9c8 got rid of it...
>
> Hm. The bug #13592 referenced in that commit appears to be about
> something else. Looks to be #13594
> https://postgr.es/m/20150828104658.2089.83265%40wrigleys.postgresql.org

Yeah, that's a typo in the commit message.

> > But maybe apply it in a combination.
>
> Yea, that's what I was thinking.

That makes sense. At the time we were not thinking (*I* was not
thinking, for sure) that you could have a not-a-service process that
runs inside a service. The fixed bug was in the same direction that you
want to fix now, just differently: the bare "isatty" test was
considering too many things as under a service, and replaced it with the
pgwin32_is_service which considers a different set of too many things as
under a service. I agree with the idea that *both* tests have to pass
in order to consider it as under a service.

--
Álvaro Herrera 39°49'30"S 73°17'W
"No hay hombre que no aspire a la plenitud, es decir,
la suma de experiencias de que un hombre es capaz"

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2021-03-04 21:17:14 Re: Removing support for COPY FROM STDIN in protocol version 2
Previous Message Jan Wieck 2021-03-04 21:01:15 Re: PROXY protocol support