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 stderr is set too as a service? > > > > Perhaps we could make the service detection more reliable by checking > > whether stderr is actually something useful? > > So IIRC, and mind that this is like 15 years ago, there is something > that looks like stderr, but the contents are thrown away. It probably > exists specifically so that programs won't crash when run as a > service...
Yea, that'd make sense. I wish we had tests for the service stuff, but that's from long before there were tap tests... > > 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 > But maybe apply it in a combination. Yea, that's what I was thinking. Gah, I don't really want to know anything about windows, I just want to hack on aio with proper working CI. Greetings, Andres Freund