Re: archive command Permission Denied? - Mailing list pgsql-general

From Tom Lane
Subject Re: archive command Permission Denied?
Date
Msg-id 24808.1226096073@sss.pgh.pa.us
Whole thread Raw
In response to archive command Permission Denied?  (Jason Long <mailing.list@supernovasoftware.com>)
Responses Re: archive command Permission Denied?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Jason Long <mailing.list@supernovasoftware.com> writes:
> I am working on archiving my WAL files.  For now I am just mailing
> myself a list of the directory contents using the following script.

> *-rwxr-xr-x 1 postgres postgres 87 Oct 28 20:23
> /var/lib/pgsql/mail-WAL-list.sh*

> I can run this when logged on as postgres and the cron runs fine as
> well, but I keep seeing the following in my logs.

> *LOG:  archive command failed with exit code 126
> DETAIL:  The failed archive command was: /var/lib/pgsql/mail-WAL-list.sh
> WARNING:  transaction log file "0000000100000000000000F0" could not be
> archived: too many failures
> sh: /var/lib/pgsql/mail-WAL-list.sh: Permission denied*

That's just bizarre.  The permissions on the script itself seem to be
fine, so the only theory that comes to mind is the server doesn't have
search (x) permission on one of the containing directory levels ... but
that's hard to believe seeing that your data directory is inside the
same tree.

[ thinks... ]  I believe that some flavors of Unix are picky about shell
scripts having a proper introducer line.  I'm not sure that would
manifest as "Permission denied", but does it work better if you
put "#! /bin/sh" as the first line of the script file?

            regards, tom lane

pgsql-general by date:

Previous
From: Mike Toews
Date:
Subject: Re: Specifying text to substitute for NULLs in selects
Next
From: Tom Lane
Date:
Subject: Re: archive command Permission Denied?