Re: Server tries to read a different config file than it is supposed to

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, twoflower <standa(dot)kurik(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Server tries to read a different config file than it is supposed to
Date: 2015-05-23 20:55:45
Message-ID: 5560E951.4020804@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 05/23/2015 08:06 AM, Tom Lane wrote:
> twoflower <standa(dot)kurik(at)gmail(dot)com> writes:
>> So I wrote a few scripts to make my life easier, e.g. *pg94start.sh*:
>> su postgres -c "/usr/lib/postgresql/9.4/bin/pg_ctl -D
>> /storage/postgresql/9.4/data -o '-c
>> config_file=/etc/postgresql/9.4/main/postgresql.conf'"
>> But running this script did not work, the server would not start.
>
> Testing this, the problem appears to be that you forgot the keyword
> "start", so pg_ctl didn't really do anything. It's always a good
> idea to redirect pg_ctl's stdout/stderr somewhere, so that you can
> look at it in event of problems. (It will *not* magically go to the
> server log file.)
>
>> So I
>> checked the log file and there was:
>> *FATAL: could not open file "/storage/postgresql/9.4/data/postgresql.conf":
>> Permission denied*
>
> I suspect this was left over from some previous attempt.
>
>> After fixing the ownership of this file, it worked.
>
> I can't explain that claim, but for me, -c config_file=something
> seems to work as you'd expect, and a look at the server source
> code confirms that it should honor that (cf SelectConfigFiles()).
> I think the documentation Adrian pointed to is a bit out of date,
> or at least oversimplified.

So order on the the command line is not important, the start up code
sets its own precedence?

>
> One possible theory is that you had an "include" directive in
> the config file in /etc, causing it to try to read the other one?
>
> regards, tom lane
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2015-05-23 21:03:20 Re: Server tries to read a different config file than it is supposed to
Previous Message David G. Johnston 2015-05-23 20:48:11 Re: PG and undo logging