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

2021-09-07 Thread Andres Freund
Hi, On 2021-08-16 15:34:51 +0200, Magnus Hagander wrote: > It wouldn't surprise me if it does break some *other* weird > cornercase, but based on the docs page you linked to it doesn't look > like it would break any of the normal/standard usecases. Yea, me neither... I do suspect that it'd have

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

2021-09-07 Thread Andres Freund
Hi, On 2021-08-15 11:25:01 -0300, Ranier Vilela wrote: > I found this function on the web, from OpenSSL, but I haven't tested it. > I think that there is one more way to test if a service is running > (SECURITY_INTERACTIVE_RID). I don't think that really addresses the issue. If a service starts p

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

2021-08-16 Thread Magnus Hagander
On Fri, Aug 13, 2021 at 3:03 PM Andres Freund wrote: > > Hi, > > Magnus, Michael, Anyone - I'd appreciate a look. > > On 2021-03-05 12:55:37 -0800, Andres Freund wrote: > > > After fighting with a windows VM for a bit (ugh), it turns out that yes, > > > there is stderr, but that fileno(stderr) ret

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

2021-08-15 Thread Ranier Vilela
Em sex., 13 de ago. de 2021 às 10:03, Andres Freund escreveu: > Hi, > > Magnus, Michael, Anyone - I'd appreciate a look. > > On 2021-03-05 12:55:37 -0800, Andres Freund wrote: > > > After fighting with a windows VM for a bit (ugh), it turns out that > yes, > > > there is stderr, but that fileno(s

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

2021-08-13 Thread Andres Freund
Hi, Magnus, Michael, Anyone - I'd appreciate a look. On 2021-03-05 12:55:37 -0800, Andres Freund wrote: > > After fighting with a windows VM for a bit (ugh), it turns out that yes, > > there is stderr, but that fileno(stderr) returns -2, and > > GetStdHandle(STD_ERROR_HANDLE) returns NULL (not IN

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

2021-03-05 Thread Andres Freund
Hi, On 2021-03-05 10:57:52 -0800, Andres Freund wrote: > On 2021-03-04 12:48:59 -0800, Andres Freund wrote: > > On 2021-03-04 21:36:23 +0100, Magnus Hagander wrote: > > > > 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

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

2021-03-05 Thread Andres Freund
Hi, On 2021-03-04 12:48:59 -0800, Andres Freund wrote: > On 2021-03-04 21:36:23 +0100, Magnus Hagander wrote: > > > 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,

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

2021-03-04 Thread Alvaro Herrera
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

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

2021-03-04 Thread Andres Freund
Hi, On 2021-03-04 21:36:23 +0100, Magnus Hagander wrote: > > 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 s

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

2021-03-04 Thread Magnus Hagander
On Thu, Mar 4, 2021 at 9:30 PM Andres Freund wrote: > > 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 mo

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

2021-03-04 Thread Andres Freund
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 sho

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

2021-03-04 Thread Magnus Hagander
On Thu, Mar 4, 2021 at 8:33 PM Andrew Dunstan wrote: > > > On 3/4/21 2:08 PM, Andres Freund wrote: > > [...] pgwin32_is_service() doesn't actually reliably detect if running as > > a service - it's a heuristic that also triggers when running postgres > > within a windows docker container (presumab

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

2021-03-04 Thread Andrew Dunstan
On 3/4/21 2:08 PM, Andres Freund wrote: > [...] pgwin32_is_service() doesn't actually reliably detect if running as > a service - it's a heuristic that also triggers when running postgres > within a windows docker container (presumably because that itself is run > from within a service?). > > > I

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

2021-03-04 Thread Andres Freund
Hi, When one tests postgres in a some of the popular CI systems (all that use docker for windows), some of the tests fail in weird ways. Like https://www.postgresql.org/message-id/20210303052011.ybplxw6q4tafwogk%40alap3.anarazel.de > t/003_recovery_targets.pl 7/9 > # Failed test '