"pg_ctl: cannot be run as root"

Started by Stefan Schwarzerabout 18 years ago4 messagesgeneral
Jump to latest
#1Stefan Schwarzer
stefan.schwarzer@grid.unep.ch

Hi there,

I installed postgres without creating another postres user/admin than
myself, as there is no other user on my machine and it's only for
testing purposes.

But strange enough, I only can start the postgres server from time to
time, normally when I have freshly restarted the machine. Now for
example, I did some changes to the postgresql.conf file, and when
trying to restart the postgres server, I get this:

gridmac7:~ schwarzer$ sudo /opt/local/lib/postgresql82/bin/pg_ctl -D
Documents/data_postgres -l logfile start
pg_ctl: cannot be run as root
Please log in (using, e.g., "su") as the (unprivileged) user that will
own the server process.

What is this? Thanks for any advice,

Stefan

PS: Running Leopard on MacPro.

Attachments:

smime.p7sapplication/pkcs7-signature; name=smime.p7sDownload
#2Thomas Pundt
mlists@rp-online.de
In reply to: Stefan Schwarzer (#1)
Re: "pg_ctl: cannot be run as root"

Hi,

On Montag, 4. Februar 2008, Stefan Schwarzer wrote:
| I installed postgres without creating another postres user/admin than
| myself, as there is no other user on my machine and it's only for
| testing purposes.
|
| But strange enough, I only can start the postgres server from time to
| time, normally when I have freshly restarted the machine. Now for
| example, I did some changes to the postgresql.conf file, and when
| trying to restart the postgres server, I get this:
|
| gridmac7:~ schwarzer$ sudo /opt/local/lib/postgresql82/bin/pg_ctl -D
| Documents/data_postgres -l logfile start
| pg_ctl: cannot be run as root
| Please log in (using, e.g., "su") as the (unprivileged) user that will
| own the server process.
|
|
| What is this? Thanks for any advice,

PostgreSQL cannot be run as user root (that's what sudo is for). If you don't
have a seperate account for PostgreSQL, run it under your account (ie without
the "sudo").

Ciao,
Thomas

--
Thomas Pundt <thomas.pundt@rp-online.de> ---- http://rp-online.de/ ----

#3Andrej Ricnik-Bay
andrej.groups@gmail.com
In reply to: Stefan Schwarzer (#1)
Re: "pg_ctl: cannot be run as root"

On 05/02/2008, Stefan Schwarzer <stefan.schwarzer@grid.unep.ch> wrote:

But strange enough, I only can start the postgres server from time to
time, normally when I have freshly restarted the machine. Now for
example, I did some changes to the postgresql.conf file, and when
trying to restart the postgres server, I get this:

...

PS: Running Leopard on MacPro.

I don't know MacOS very well, and it's been a while that I last
had my hands on MacOS X (>2 years). Are you saying that
you use MacOS as user root by default, rather than as a non
privileged account?

Cheers,
Andrej

--
Please don't top post, and don't use HTML e-Mail :} Make your quotes concise.

http://www.american.edu/econ/notes/htmlmail.htm

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrej Ricnik-Bay (#3)
Re: "pg_ctl: cannot be run as root"

"Andrej Ricnik-Bay" <andrej.groups@gmail.com> writes:

I don't know MacOS very well, and it's been a while that I last
had my hands on MacOS X (>2 years). Are you saying that
you use MacOS as user root by default, rather than as a non
privileged account?

Certainly not. The problem was the "sudo" in the OP's command.

regards, tom lane