'pg_ctl restart' confused about pathname to postgresql.conf - Mailing list pgsql-bugs

From Josh Kupershmidt
Subject 'pg_ctl restart' confused about pathname to postgresql.conf
Date
Msg-id CAK3UJRGABxWSOCXnAsSYw5BfR4D9ageXF+6GtsRVm-LtfWfW=g@mail.gmail.com
Whole thread Raw
Responses Re: 'pg_ctl restart' confused about pathname to postgresql.conf  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-bugs by date:

Previous
From: Robert Haas
Date:
Subject: Re: BUG #6261: 35.9. C-Language Functions
Next
From: "Keith Fiske"
Date:
Subject: BUG #6264: Superuser does not have inherent Replication permission