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 1oOzeI-0006XE-K8 for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Aug 2022 10:54:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oOzeH-0001qI-2i for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Aug 2022 10:54:45 +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 1oOzeG-0001q8-Q7 for pgsql-hackers@lists.postgresql.org; Fri, 19 Aug 2022 10:54:44 +0000 Received: from feynman.df7cb.de ([195.49.152.168]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oOze9-0001zB-Sy for pgsql-hackers@lists.postgresql.org; Fri, 19 Aug 2022 10:54:43 +0000 Received: from msg.df7cb.de (unknown [IPv6:2003:5b:203b:100:7627:eaff:fe52:8e03]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by feynman.df7cb.de (Postfix) with ESMTPSA id 4M8JY702S5z3F3q; Fri, 19 Aug 2022 12:54:34 +0200 (CEST) Date: Fri, 19 Aug 2022 12:54:34 +0200 From: Christoph Berg To: Bharath Rupireddy Cc: Daniel Gustafsson , PostgreSQL Hackers Subject: Re: pg_receivewal and SIGTERM Message-ID: Mail-Followup-To: Christoph Berg , Bharath Rupireddy , Daniel Gustafsson , PostgreSQL Hackers References: <15338147-16C0-4D4D-8CAD-460102857BF6@yesql.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Re: Bharath Rupireddy > pg_receivewal will exit with status 0 when > - terminated by the SIGINT signal. (That is the > + terminated by the SIGINT or > + SIGTERM signal. (That is the > normal way to end it. Hence it is not an error.) For fatal errors or > other signals, the exit status will be nonzero. > > Can we specify the reason in the docs why a SIGTERM causes (which > typically would cause a program to end with non-zero exit code) > pg_receivewal and pg_recvlogical exit with zero exit code? Having this > in the commit message would help developers but the documentation will > help users out there. We could add "because you want that if it's running as a daemon", but TBH, I'd rather remove the parentheses part. It sounds too much like "it works that way because that way is the sane way". Christoph