Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHv8p-0000gB-Hg for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Mar 2021 21:04:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lHv8o-0000kZ-Fi for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Mar 2021 21:04:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHv8o-0000kS-8T for pgsql-hackers@lists.postgresql.org; Thu, 04 Mar 2021 21:04:14 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHv8l-0007lU-T3 for pgsql-hackers@postgresql.org; Thu, 04 Mar 2021 21:04:13 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 6CAE012A6; Thu, 4 Mar 2021 16:04:09 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 04 Mar 2021 16:04:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=gbtKqLhVoBVvUJmlyX/tcj8UGkCkISXQ1t6/JVXG5iU=; b=VgknLy4+ dFM8JJ0KwRmt+9uNInFEXGcOy8C4dfZAjcujfOxaT94ejUPbs0WNdzggpWKImwai lnGMKdMJjHCymErW/rTF+dvgRcVyvSyVwX1xqbE+9TMN6ZdBYTX2kKGljGvrzLMO 748poQg52S6k9auYIF2TtAb30a0tThrKfTHLyR6PjVnEpWSMyyuYL++AawbRd+7/ Ez1+qmUCs8HIOpW1i7T9G022uuPb6yAu3q06hFVRj/fbUmNgy3gmpLUGxBqiYgG7 GdYU3+K1pENRtsAhiEsq1a3nVdmRapaPSYJG9HiTr+x9OOoUFSlKWgJyUWhWe+wV CmQGMjJUChyxIw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddtgedgudefgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjggfsehtkeertddtredunecuhfhrohhmpeetlhhv rghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorh hgqeenucggtffrrghtthgvrhhnpefghfehgfdtiedugfdvkeehgfeggfehjeekjefhhfej jeeftdfgkedugfevjedvtdenucffohhmrghinhepphhoshhtghhrrdgvshenucfkphepud eltddrleehrdduledrleehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA id 5CB78240054; Thu, 4 Mar 2021 16:04:06 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 97C4C2A14F6; Thu, 4 Mar 2021 18:04:03 -0300 (-03) Date: Thu, 4 Mar 2021 18:04:03 -0300 From: Alvaro Herrera To: Andres Freund Cc: Magnus Hagander , Michael Paquier , Dave Page , Andrew Dunstan , PostgreSQL-development , Thomas Munro , Heikki Linnakangas Subject: Re: CI/windows docker vs "am a service" autodetection on windows Message-ID: <20210304210403.GA20642@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210304204859.65z6ynqicmlobi7r@alap3.anarazel.de> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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"