Thread: failed to start postgresql service

failed to start postgresql service

From
Gergely Buday
Date:
Hi there,

I created a directory /usr/local/pgsql/data to store the data of
postgresql and ran

$ initdb -D /usr/local/pgsql/data

After that, I tried to start the postgresql service on my fedora 15 box via

$ sudo service postgresql start

but it has failed with the message

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

I do not see any postgresql related log or dir in /var/log, and
/var/log/messages say

Aug  4 13:07:20 homeship systemd[1]: postgresql.service: control
process exited, code=exited status=1
Aug  4 13:07:20 homeship systemd[1]: Unit postgresql.service entered
failed state.

which is not very useful. Systemctl says

$ systemctl status postgresql.service
postgresql.service - LSB: start and stop PostgreSQL server
      Loaded: loaded (/etc/rc.d/init.d/postgresql)
      Active: failed since Thu, 04 Aug 2011 13:27:28 +0200; 19s ago
     Process: 4692 ExecStart=/etc/rc.d/init.d/postgresql start
(code=exited, status=1/FAILURE)
      CGroup: name=systemd:/system/postgresql.service

which is not telling what has failed, again.

How can I learn more about why it has failed?

- Gergely

Re: failed to start postgresql service

From
Jerry Sievers
Date:
Gergely Buday <gbuday@gmail.com> writes:

> Hi there,
>
> I created a directory /usr/local/pgsql/data to store the data of
> postgresql and ran
>
> $ initdb -D /usr/local/pgsql/data
>
> After that, I tried to start the postgresql service on my fedora 15 box via
>
> $ sudo service postgresql start
>
> but it has failed with the message
>
> Starting postgresql (via systemctl):  Job failed. See system logs and
> 'systemctl status' for details.
>                                                            [FAILED]

Set and export the PGDATA variable in the rc script to the data
dirrectory path and try again.

Or try;

pg_ctl -D /usr/local/pgsql/data start

--
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net
p: 305.321.1144

Re: failed to start postgresql service

From
Gergely Buday
Date:
> Set and export the PGDATA variable in the rc script to the data
> dirrectory path and try again.

Thanks it worked.

- Gergely