Recently I had the problem of starting a postgresql service with custom PGDATA path. It tried to look in the default data directory (/var/lib/pgsql/9.3/data/) which was not initialized and therefore triggered these errors. It appears the problem is that the service starter on Centos 7 strips all the environment variables, including PGDATA.
Interesting thread on the issue
Is there a way to configure
service postgresql-9.3 start
to use custom environment variables? Are there configuration files for services where these variables have to be defined?
Thank you in advance!
/etc/default/$servicenamewhen it runs and you can configure variables there. Does the pgsql init script do that? I don't know you'd have to look./etc/defaultdirectory and then create that with whatever variables/etc. you need.grep /etc/rc.d/init.d/postgresql-9.3 /defaultis likely a good start.