1

I'm trying to start the service but it isn't starting... It says:

[....] Starting PostgreSQL 9.6 database server: main[....] The PostgreSQL server failed to start. Please check the log output: 2016-10-25 15:24:26 BDT [4118-1] LOG: could not create IPv6 socket: Permission denied 2016-10-25 15:24:26 BDT [4118-2] LOG: could not create IPv4 socket: Permission denied 2016-10-25 15:24:26 BDT [4118-3] WARNING: could not create listen socket for "localhost" 2016-10-25 15:24:26 BDT [4118-4] FATAL: could not create any TCP/IP sockets 2016-10-25 15:24:26 BDT [4118-5] LOG: da[FAILe system is shut down ... failed! failed!

The log file:

2016-10-25 15:25:41 BDT [4330-1] LOG:  could not create IPv6 socket: Permission denied
2016-10-25 15:25:41 BDT [4330-2] LOG:  could not create IPv4 socket: Permission denied
2016-10-25 15:25:41 BDT [4330-3] WARNING:  could not create listen socket for "localhost"
2016-10-25 15:25:41 BDT [4330-4] FATAL:  could not create any TCP/IP sockets
2016-10-25 15:25:41 BDT [4330-5] LOG:  database system is shut down

What should I do?

  • 1
    well permission to start the service is denied, try it with sudo! – mahatmanich Oct 25 '16 at 9:49
  • I am the root user – Fahim Ferdous Oct 25 '16 at 11:02
  • are the ports already taken by another resource? – mahatmanich Oct 25 '16 at 11:14
  • or is the service already running? – mahatmanich Oct 25 '16 at 12:01
  • Could you check the output of sudo netstat -tulpn and sudo lsof -i to see what the port and service situation is indeed? – David B. Oct 25 '16 at 12:52
1

The permission denied message means one of the two things - Either the user account you are using does not have permission to run the requested program, if you are logged in as root then remember to use sudo.

The second this that is can mean is that the port or resource is currently being used by another program.

In the logfile we see that the daemon cannot open the the port the software is trying to use:

2016-10-25 15:25:41 BDT [4330-1] LOG:  could not create IPv6 socket: Permission denied
2016-10-25 15:25:41 BDT [4330-2] LOG:  could not create IPv4 socket: Permission denied
2016-10-25 15:25:41 BDT [4330-3] WARNING:  could not create listen socket for "localhost"
2016-10-25 15:25:41 BDT [4330-4] FATAL:  could not create any TCP/IP sockets
2016-10-25 15:25:41 BDT [4330-5] LOG:  database system is shut down

This suggests that it is being used by another process.

As mentioned in the comments, try using:

sudo netstat -tulpn

and

sudo lsof -i

to see if there are any other services attempting to use the same port on the machine. If necessary, change the port used by PosgreSQL and this issue should resolve itself.

  • I also changed the port number but nothing happened. I don't have any other user besides root. Is that causing the problem? – Fahim Ferdous Oct 25 '16 at 17:03
  • Port 5432 isn't being used by any other process. I also tried starting mysql but that didn't start either. But other services are running I.e. apache. – Fahim Ferdous Oct 25 '16 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.