Skip site navigation (1) Skip section navigation (2)

'pg_ctl restart' confused about pathname to postgresql.conf

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: 'pg_ctl restart' confused about pathname to postgresql.conf
Date: 2011-10-21 21:51:28
Message-ID: CAK3UJRGABxWSOCXnAsSYw5BfR4D9ageXF+6GtsRVm-LtfWfW=g@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
I've noticed that I occasionally see errors from "pg_ctl restart"  claiming:
  postgres cannot access the server configuration file ... No such
file or directory

depending on what directory I execute "pg_ctl restart" from, and where
the postmaster was originally started from. I boiled this problem down
to the attached test case. I've seen this problem on 9.1.1 and git
head. The testcase was tried on OS X and Debian, with Postgres
installed locally like this:
  ./configure --prefix=/home/postgres/runtime/ --with-python --enable-debug

You can run the test case stand-alone, though it's probably easier to
see what's going on if you just copy-paste into your terminal: at the
end you should wind up with your current directory "/tmp/foo/". You
should see that the last command, "pg_ctl -D $DATADIR restart" failed
to start the server back up, complaining:
  postgres cannot access the server configuration file
"/tmp/foo/baz/postgresql.conf": No such file or directory

even though $DATADIR is clearly set to "/tmp/foo/bar/baz/" (N.B.
directory "bar" has gone missing in the above error message). A
"pg_ctl -D $DATADIR start" should work at this point, though. This
seems like some bug in normalizing the absolute path to
postgresql.conf.

Josh

Attachment: pg_ctl_weirdness.sh
Description: application/x-sh (845 bytes)

Responses

pgsql-bugs by date

Next:From: Keith FiskeDate: 2011-10-21 21:54:56
Subject: BUG #6264: Superuser does not have inherent Replication permission
Previous:From: Robert HaasDate: 2011-10-21 12:55:26
Subject: Re: BUG #6261: 35.9. C-Language Functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group