Failed to start postgresql database

Seth Anghelo Di Noire asked:

Trying to setup Postgresql on Centos7 with WHM and CPANEL
Its installed fine but when I try to start it I get the following callback


-- Unit postgresql-9.5.service has begun starting up.
Apr 18 15:54:48 node1817.myfcloud.com pg_ctl[25929]: < 2019-04-18 15:54:48.619 UTC >LOG:  could not bind IPv6 socket: Address already in use
Apr 18 15:54:48 node1817.myfcloud.com pg_ctl[25929]: < 2019-04-18 15:54:48.619 UTC >HINT:  Is another postmaster already running on port 5432? If not, wait a
Apr 18 15:54:48 node1817.myfcloud.com pg_ctl[25929]: < 2019-04-18 15:54:48.619 UTC >LOG:  could not bind IPv4 socket: Address already in use
Apr 18 15:54:48 node1817.myfcloud.com pg_ctl[25929]: < 2019-04-18 15:54:48.619 UTC >HINT:  Is another postmaster already running on port 5432? If not, wait a
Apr 18 15:54:48 node1817.myfcloud.com pg_ctl[25929]: < 2019-04-18 15:54:48.619 UTC >WARNING:  could not create listen socket for "localhost"
Apr 18 15:54:48 node1817.myfcloud.com pg_ctl[25929]: < 2019-04-18 15:54:48.619 UTC >FATAL:  could not create any TCP/IP sockets
Apr 18 15:54:49 node1817.myfcloud.com pg_ctl[25929]: pg_ctl: could not start server
Apr 18 15:54:49 node1817.myfcloud.com pg_ctl[25929]: Examine the log output.
Apr 18 15:54:49 node1817.myfcloud.com systemd[1]: postgresql-9.5.service: control process exited, code=exited status=1
Apr 18 15:54:49 node1817.myfcloud.com systemd[1]: Failed to start PostgreSQL 9.5 database server.
-- Subject: Unit postgresql-9.5.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql-9.5.service has failed.

Mysql is in running and I’m thinking that may be covering the ports.
But I’m unsure of how to uninstall mysql, or free up the ports so that Postgresql can start up and use them.

My answer:


PostgreSQL is already running, but someone started it manually instead of via the systemd unit. Kill the existing PostgreSQL process before trying to start another.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.