archive_command failures report confusing exit status

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: archive_command failures report confusing exit status
Date: 2007-12-10 17:27:23
Message-ID: 200712101827.23978.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Failures of archive_command calls report a confusing exit status such as:

LOG: archive command "cp 'pg_xlog/000000010000000000000000' '/nonexistent/000000010000000000000000'" failed: return code 256

The actual return code is 1; it neglects to apply WEXITSTATUS().

I figured it would make sense if pgarch.c used the same mechanism that
postmaster.c uses to report the various variants of regular and signal
exits.

I have attached a patch in that direction. It obviously needs a bit of
string struggling to get all the cases right, but the idea should be
clear. Comments?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

Attachment Content-Type Size
log-archive-command-exitstatus.patch text/x-diff 2.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2007-12-10 17:38:28 Re: Release Note Changes
Previous Message Hiroshi Saito 2007-12-10 17:17:05 Re: Problem of a server gettext message.