PDA

View Full Version : Postgres won't start


scorpio2002
18th April 2011, 03:53 PM
Hi there,
I installed postgres but I can't start it:


# service postgresql start
Starting postgresql (via systemctl): Job failed. See system logs and 'systemctl status' for details.
[FAILED]


Now, I checked some logs and there is nothing. The systemctl command just gives me useless info:

# systemctl --failed
UNIT LOAD ACTIVE SUB JOB DESCRIPTION
postgresql.service loaded failed failed SYSV: PostgreSQL database server.


This looks scary: error messages should be shown clearly, not hidden carefully. Where can I find thee actual error? xD

---------- Post added at 06:53 AM ---------- Previous post was at 05:50 AM ----------

I solved the problem by running:

initdb -D /var/lib/pgsql/data/

AdamW
19th April 2011, 12:09 AM
systemctl status postgresql.service would give you more details. systemctl --failed is just a summary view of failed services.

jvillain
19th April 2011, 01:24 AM

You need to initialize the database first. I think the command is initdb. If you don't want to use all the defaults make sure you change them before running initdb. If you do a

rpm -ql postgresql-server

you should see it listed in there some where. I think it is some where down in /var/lib or just /lib.

drunkahol
27th April 2011, 03:04 PM
Had the same problem - fixed in the same way.

Don't the startup scripts check for initialisation and run if necessary? I thought it used to?

Cheers

Duncan