Reputation: 123
I followed this Almost idiot's guide to install postgresql and postgis on Centos 7 and got stuck starting the database itself with the following command:
[root@localhost cmaps]# service postgresql-9.3 initdb
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
If I install the postgresql package from Centos repository (version 9.2) the command works, but then I they don't have postgis, and there is no official posgresql-92 repository for Centos 7.
Any idea on what's happening?
Thank you!
Upvotes: 12
Views: 10785
Reputation: 2673
For Centos 7.3 installed on MS Azure platform the script is located at
/usr/bin/postgresql-setup initdb
the version number is absent from the name of these as well:
/var/lib/pgsql/data/
/sbin/service postgresql status
or systemctl status postgresql.service
Upvotes: 0
Reputation: 408
I had the same problem and solve it by changing the path
/usr/pgsql-9.3/bin/postgresql93-setup initdb
Note that the path is different
Upvotes: 21
Reputation: 324475
CentOS 7 is based on systemd. PostgreSQL packages use a different command for initdb there:
/usr/lib/pgsql-9.3/bin/postgresql93-setup initdb
On older versions, call the initscript directly.
/etc/init.d/postgresql-9.3 initdb
Upvotes: 6