Bug 708662 - Package does not create a suitable data dir
Summary: Package does not create a suitable data dir
Keywords:
Status: CLOSED DUPLICATE of bug 622663
Alias: None
Product: Fedora
Classification: Fedora
Component: postgresql
Version: 15
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Tom Lane
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-28 17:29 UTC by afanen01
Modified: 2013-07-03 03:37 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-28 19:03:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description afanen01 2011-05-28 17:29:17 UTC
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 19:03:54 UTC
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 19:13:56 UTC
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 19:14:18 UTC

*** 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.