public inbox for [email protected]
help / color / mirror / Atom feed[PATCH] Clarify semantics of restore_command exit status
2+ messages / 2 participants
[nested] [flat]
* [PATCH] Clarify semantics of restore_command exit status
@ 2016-03-23 17:04 Andreas Seltenreich <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Seltenreich @ 2016-03-23 17:04 UTC (permalink / raw)
To: pgsql-docs
Hi,
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.
Proposed fix below.
regards,
Andreas
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 <systemitem>SIGTERM</systemitem>, 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.
</para>
<para>
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
</programlisting>
An exception is that if the command was terminated by a signal (other
than <systemitem>SIGTERM</systemitem>, 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.
</para>
</listitem>
</varlistentry>
--
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [PATCH] Clarify semantics of restore_command exit status
@ 2016-04-16 01:12 Peter Eisentraut <[email protected]>
parent: Andreas Seltenreich <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Peter Eisentraut @ 2016-04-16 01:12 UTC (permalink / raw)
To: Andreas Seltenreich <[email protected]>; pgsql-docs
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 <systemitem>SIGTERM</systemitem>, 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.
> </para>
>
> <para>
> 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
> </programlisting>
> An exception is that if the command was terminated by a signal (other
> than <systemitem>SIGTERM</systemitem>, 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.
> </para>
> </listitem>
> </varlistentry>
>
>
--
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2016-04-16 01:12 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-03-23 17:04 [PATCH] Clarify semantics of restore_command exit status Andreas Seltenreich <[email protected]>
2016-04-16 01:12 ` Peter Eisentraut <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox