Virtualmin says 'pg_hba.conf' was not found but clicking on initialise button does not work

On a new Virtualmin install, going through the set-up says:

The PostgreSQL host configuration file /var/lib/pgsql/data/pg_hba.conf was not found on your system, indicating that the database has not been initialized yet. Click the button below to setup PostgreSQL.

When I click on initialise it says:

sh: postgresql-setup: command not found

However, PG has already been installed and initialised as I used the /usr/pgsql-9.3/bin/postgresql93-setup initdb command (and when running it again it says Data directory is not empty!.

Any ideas what’s going on please?

I think this could be a bug as I can’t use this either (just shows me details of ‘usage’)

virtualmin config-system PostgreSQL

Or if I go to modules and click on the Postgres module it reports the same thing as per the original post so I can’t even check if it has been configured properly.

I created an issue for this too as I believe it is a bug. Here’s my update there:

Ok so the file exists at /var/lib/pgsql/9.3/data/pg_hba.conf and from memory (on my previous installs), I was able to enter that filename manually in the Postgres webmin module page - but that page no longer lets you make any changes since it reports The PostgreSQL host configuration file /var/lib/pgsql/data/pg_hba.conf was not found on your system, indicating that the database has not been initialized yet. Click the button below to setup PostgreSQL.

Can I edit the webmin module file manually via the terminal?

Ok found it! There was a cog icon in the top left/right corner which I hadn’t spotted earlier.

It needs to be updated with the following info (presuming you are using pg 9.3)

Path to psql command:
/usr/pgsql-9.3/bin/psql
Command to start PostgreSQL:
systemctl start postgresql-9.3
Command to stop PostgreSQL:
systemctl stop postgresql-9.3
Command to initialize PostgreSQ:
/usr/pgsql-9.3/bin/postgresql93-setup initdb
Path to postmaster PID file:
/var/lib/pgsql/9.3/data/postmaster.pid
Paths to host access config file:
/var/lib/pgsql/9.3/data/pg_hba.conf
Path to pg_dump command:
/usr/pgsql-9.3/bin/pg_dump
Path to pg_restore command:
/usr/pgsql-9.3/bin/pg_restore
Default backup repository directory:
/home/postgres_backups