title: Centos 7 environment variables for Postgres service
body: <p>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.</p>
  
  <p><a href="https://unix.stackexchange.com/questions/44370/how-to-make-unix-service-see-environment-variables">Interesting thread on the issue</a></p>
  
  <p>Is there a way to configure </p>
  
  <pre><code>service postgresql-9.3 start
  </code></pre>
  
  <p>to use custom environment variables? Are there configuration files for services where these variables have to be defined?</p>
  
  <p>Thank you in advance!</p>