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

From: Andres Freund <andres(at)anarazel(dot)de>
To: Magnus Hagander <magnus(at)hagander(dot)net>, Dave Page <dpage(at)pgadmin(dot)org>
Cc: 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 20:30:08
Message-ID: 20210304203008.zy3op3fisra5tlun@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2021-03-04 21:08:30 +0100, Magnus Hagander wrote:
> The problem with doing it at register time is that everybody who
> builds an installer for PostgreSQL will then have to do it in their
> own registration (I'm pretty sure most of them don't use pg_ctl
> register).

Well, hm, maybe they should change that?

> The same thing in pgwin32_doRunAsService() might help with that.

What do you mean by this?

> But then we'd have to figure out what to do if pg_ctl fails prior to
> reaching that point... There aren't that many such paths, but there
> are some.
>
> Just throwing out ideas without spending time thinking about it, maybe
> log to *both* in the case when we pick by it by autodetection?

I think that's a good answer for pg_ctl - not so sure about postgres
itself, at least once it's up and running. I don't know what lead to all
of this autodetection stuff, but is there the possibility of blocking on
whatever stderr is set too as a service?

Perhaps we could make the service detection more reliable by checking
whether stderr is actually something useful?

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...

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2021-03-04 20:36:23 Re: CI/windows docker vs "am a service" autodetection on windows
Previous Message Jan Wieck 2021-03-04 20:29:28 Re: PROXY protocol support