Red Hat Bugzilla – Bug 708662
Package does not create a suitable data dir
Last modified: 2013-07-02 23:37:36 EDT
Description of problem:
Installing the postgresql-server package does not create a data dir, which causes the service to fail to start.
Version-Release number of selected component (if applicable): 9.04
How reproducible: always.
Steps to Reproduce:
1. Install postgresql-server
2. try to start the service using "service postgresql start"
it fails with a message advising you to view system logs. The logs do not contain useful information
It starts successfully, or shows pertinent information in the system log
If you create the folder "/var/lib/pgsql/data" and assign ownership to /var/lib/pgsql/* to user "postgres" and then run command "service postgresql start", it works successfully
This is not a bug. Run
service postgresql initdb
before starting up the server. It will give you this message:
echo $"$PGDATA is missing. Use \"service postgresql initdb\" to initialize the cluster first."
when you don't create anything on your own.
It's not a bug that you have to do a manual "service postgresql initdb" before "service start" will succeed. That's an intentional safety feature. We used to have logic in the initscript to do an automatic initdb if the data directory seemed to not be there, but it was removed after a couple of disastrous cases of the auto-initdb overwriting someone's database :-(
Now, it *is* a bug that you don't see the message suggesting that you need to do "service initdb". But that's not the postgresql package's fault; it's the fault of systemd, which is intentionally routing all diagnostic output from initscripts to /dev/null. See bug #622663 for some of the complaining about the fact that F15 has gone live without any solution for that problem.
*** This bug has been marked as a duplicate of bug 622663 ***