Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1arEml-0007lY-9v for pgsql-docs@arkaria.postgresql.org; Sat, 16 Apr 2016 01:12:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1arEmk-000711-Ju for pgsql-docs@arkaria.postgresql.org; Sat, 16 Apr 2016 01:12:30 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1arEmk-00070u-3b for pgsql-docs@postgresql.org; Sat, 16 Apr 2016 01:12:30 +0000 Received: from mout.gmx.net ([212.227.17.21]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.84_2) (envelope-from ) id 1arEmh-0006qR-Dz for pgsql-docs@postgresql.org; Sat, 16 Apr 2016 01:12:28 +0000 Received: from auth1-smtp.messagingengine.com ([66.111.4.227]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0Lr46Z-1bM9oh1tVz-00eYvQ for ; Sat, 16 Apr 2016 03:12:24 +0200 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 27D4420A0D for ; Fri, 15 Apr 2016 21:12:23 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Fri, 15 Apr 2016 21:12:23 -0400 X-Sasl-enc: bp0HseMJ7sQUPf1lcAziYxV+yz1/JKWHgnHBq/it1p5H 1460769142 Received: from vanquo.pezone.net (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id D92C7680204; Fri, 15 Apr 2016 21:12:22 -0400 (EDT) Subject: Re: [PATCH] Clarify semantics of restore_command exit status To: Andreas Seltenreich , pgsql-docs@postgresql.org References: <87y499yvkk.fsf@oort.credativ.de> From: Peter Eisentraut Message-ID: <57119176.70602@gmx.net> Date: Fri, 15 Apr 2016 21:12:22 -0400 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 In-Reply-To: <87y499yvkk.fsf@oort.credativ.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:ogXIIQh0Czl/IUim7YSK+9qkYGpQaQpU41dvqo0xFi2cNtXXl5l 7QaAvvJxHUJvOAs+Mgr3uEYY7U/vzesT/3Vz2+3iWw1Fecjgb2ig6NLtENJUXpB73gQo29z 1YI/yQP7JKcCTX0XhL140rFpIpyX5UmKN1C2qAqsBzwFI7UX0KirxSgcjiwf0EO81k1H5x9 A1qGXOncPn0O1uIPJw2Yg== X-UI-Out-Filterresults: notjunk:1;V01:K0:2VqhyrIsKVs=:qxgUAO1Ml/7tE0PgC+9ZCk IZxpr3Vn7InFzIwGfVObm+BYoVmzdfxBU4olg59MO47819nB4lhNRVEY1Z95mvl40kksMlddR nUIbrYE7QU6SK5XwIIDlHw37e1D8CYM+ER1NV31Ri6xeJkwh2Aoy+SfGq1Hb5lglG86SpTvsa v7RhYbmP7cr22IWOHrk7slz5hobzbAWBrGHEUnBfEBsMe+HZ2D4fWKIu0v7W4jy52C+p6skxT ImqvVppTGRdlvIvATY15ci8nVcQyj4Z9Q7WfETmhH45frZqzrgq0Kg5hqhaAO9/DWXzAANBIN IRDO547SGD3zwmrSLhOWkb4Iwa3Ys2B8ETsjQDOZFMFHyL0aKDgHRkDIoWoomonm4UUz1e7Y3 jkxGN1p94ZYoGKNVg02G+87vPGNxH4/HIaPNvUj+1llXN8q6TU+ifta0dSjUKyYBm5r1PmNSz e3EG+pQdVyVorMrMpNPZa2XCdv9uAEgyZMadKNWOYHL9qpFFKGwjlcDHkdVkGkEnTtKPMeFrZ lUuNs14ZRdzD+9LoTs2WygCeN7lrpjYjH1B7l/GEwjPMDTpgB9NnJ/QO82tjdN1njHgRMKJ+H nvlePGQuqvVf3reWXoI0kHps1Gl9L+adt1kx2ynaAda7weEEret0GOgtaW7Qy1K+w1zUVZmJ5 Djav3BgbDLXzNKffC546dGrVUabxwG3Ia18WeIzNEpHtiEJwp2cWoywa51vJDwKspjKj9+gCE dWQgfCJ22sBblOZrHgdasPsTpiF9axb9ltAAhWAkrd1H0KC7DPPxTcZfmtwrU85rjKmNI8eE9 oMed2IQ X-Pg-Spam-Score: -3.6 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org On 03/23/2016 01:04 PM, Andreas Seltenreich wrote: > the documentation is not clear about which of the non-zero exit codes of > a restore_command are considered FATAL and which are considered a > temporary failure. I had to look at the source to find the answer. I think this goes a bit too much into implementation details. As long as the shell command sticks to the normal exit code range and uses signals properly, it all works. If we do feel we need to go into more detail, does this only apply to restore_command, or also to other places where we call shell commands? > diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml > index 9092cf8..6fa7d40 100644 > --- a/doc/src/sgml/backup.sgml > +++ b/doc/src/sgml/backup.sgml > @@ -1114,9 +1114,9 @@ restore_command = 'cp /mnt/server/archivedir/%f %p' > present in the archive; it must return nonzero when so asked. This is not > an error condition. An exception is that if the command was terminated by > a signal (other than SIGTERM, which is used as > - part of a database server shutdown) or an error by the shell (such as > - command not found), then recovery will abort and the server will not start > - up. > + part of a database server shutdown) or an exit status greater than 125 > + (such as command not found by the shell), then recovery will abort and the > + server will not start up. > > > > diff --git a/doc/src/sgml/recovery-config.sgml b/doc/src/sgml/recovery-config.sgml > index 26af221..66d5e62 100644 > --- a/doc/src/sgml/recovery-config.sgml > +++ b/doc/src/sgml/recovery-config.sgml > @@ -73,8 +73,9 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows > > An exception is that if the command was terminated by a signal (other > than SIGTERM, which is used as part of a > - database server shutdown) or an error by the shell (such as command > - not found), then recovery will abort and the server will not start up. > + database server shutdown) or an exit status greater than 125 (such as > + command not found by the shell), then recovery will abort and the > + server will not start up. > > > > > -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs