Bug 708662 - Package does not create a suitable data dir
Package does not create a suitable data dir
Status: CLOSED DUPLICATE of bug 622663
Product: Fedora
Classification: Fedora
Component: postgresql (Show other bugs)
15
Unspecified Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Tom Lane
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-28 13:29 EDT by afanen01
Modified: 2013-07-02 23:37 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-28 15:03:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description afanen01 2011-05-28 13:29:17 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"
  
Actual results:
it fails with a message advising you to view system logs. The logs do not contain useful information

Expected results:
It starts successfully, or shows pertinent information in the system log

Additional info:
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
Comment 1 Devrim GÜNDÜZ 2011-05-28 15:03:54 EDT
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.
Comment 2 Tom Lane 2011-05-28 15:13:56 EDT
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.
Comment 3 Tom Lane 2011-05-28 15:14:18 EDT

*** This bug has been marked as a duplicate of bug 622663 ***

Note You need to log in before you can comment on or make changes to this bug.