Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"root" execution of the PostgreSQL server is not permitted

When I try to start postgresql I get an error:

postgres 

postgres does not know where to find the server configuration file.
You must specify the --config-file or -D invocation option or set the PGDATA environment variable.

So then I try to set my config file:

postgres -D /usr/local/var/postgres 

And I get the following error:

postgres cannot access the server configuration file "/usr/local/var/postgres/postgresql.conf": Permission denied

Hmm okay. Next, I try to perform that same action as an admin:

 sudo postgres -D /usr/local/var/postgres 

And I receive the following error:

"root" execution of the PostgreSQL server is not permitted.
The server must be started under an unprivileged user ID to prevent possible system security compromise. See the documentation for more information on how to properly start the server.

I googled around for that error message but cannot find a solution.
Can anyone provide some insight into this?

like image 379
chopper draw lion4 Avatar asked Feb 04 '15 01:02

chopper draw lion4


Video Answer


1 Answers

For those trying to run custom command using the official docker image, use the following command. docker-entrypoint.sh handles switching the user and handling other permissions.

docker-entrypoint.sh -c 'shared_buffers=256MB' -c 'max_connections=200' 
like image 110
Muthukumar Avatar answered Sep 24 '22 02:09

Muthukumar