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?

7
  • 1
    well permission to start the service is denied, try it with sudo! Commented Oct 25, 2016 at 9:49
  • I am the root user Commented Oct 25, 2016 at 11:02
  • are the ports already taken by another resource? Commented Oct 25, 2016 at 11:14
  • or is the service already running? Commented Oct 25, 2016 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.
    Commented Oct 25, 2016 at 12:52

2 Answers 2

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.

2
  • I also changed the port number but nothing happened. I don't have any other user besides root. Is that causing the problem? Commented Oct 25, 2016 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. Commented Oct 25, 2016 at 17:05
0

you are most likely to be running android with CONFIG_ANDROID_PARANOID_NETWORK enabled in the kernel

try adding postgres user to these groups:aid_bt aid_bt_net aid_inet aid_net_raw aid_admin

usermod -a -G aid_bt,aid_bt_net,aid_inet,aid_net_raw,aid_admin postgres

create these groups beforehand:

groupadd -g 3001 aid_bt
groupadd -g 3002 aid_bt_net
groupadd -g 3003 aid_inet
groupadd -g 3004 aid_net_raw
groupadd -g 3005 aid_admin

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .