• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

psadump complains about pg_ctl

J

jdstevens

Guest
I submit

/usr/local/psa/bin/psadump --nostop -f /tmp/

as the root user. An early message in the log file is:

Checking packages installation ... done
Check postgres database existing ... found postgres database(s).
Check Postgres server running ... pg_ctl: cannot be run as root
Please log in (using, e.g., "su") as the (unprivileged) user that will
own the server process.
is not running

The psadump proceeds, but doesn't appear to properly handle anything related to postgresql.

Suggestions?
 
You wouldn't be happening to be running Red Hat Enterprise Linux would you? If so, I'm having the same problem, but trying to run psarestore on a new server.

This is a known issue and I was told by Plesk support that it will be fixed in 7.5.2. That should be coming out this week or the next.

Hope that helps
 
I'm using Fedora Core 2. I created a way to work around the problem. I don't think this creates a security risk, but I can't guarantee that.

mv /usr/bin/pg_ctl /usr/bin/pg_ctl.orig

Create a new /usr/bin/pg_ctl that looks like this:

#!/bin/sh -x
su - postgres -c "/usr/bin/pg_ctl.orig $*"

I put in -x to echo progress of the command. Ownership and permissions of the new pg_ctl should be root:root 755, the same as pg_ctl.orig. If the command is run by root, su succeeds. If it is run by another user, the script will prompt for a password. On my system, postgres has no password so the command will always fail unless invoked by root.
 
Hi,

I had the same problem earlier, here is wat SWSoft support did:

Comment # strings from line 114 to 121 in /usr/bin/pg_ctl.

Now all works fine !

Regards,
Bart
 
Back
Top