An error about OpenVAS.

Hello,
When I launch “gvm-check-setup” then it show me:

FIX: Run 'sudo runuser -u postgres -- /usr/share/gvm/create-postgresql-database'

And the above command show me:

$sudo runuser -u postgres -- /usr/share/gvm/create-postgresql-database
createuser: error: could not connect to database postgres: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
createdb: error: could not connect to database template1: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
psql: error: could not connect to server: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
psql: error: could not connect to server: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
psql: error: could not connect to server: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

How can I fix it?

Thank you.

Hi Jason, lets start by taking a look at what the error message is telling us.

psql: error: could not connect to server: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?

Well we better do what the man says. In Parrot, as well as I think all systemd managed distros, postgres runs as a service managed by systemd,

  • “Great thanks for the tip, how do I fix this”

Right. Check the status of system services simply by running:

sudo service <the-service-name> status

Using tab to auto-complete the service name will help you find the correct name, as well as discover things on your system you may never have known about. I’ll leave it to you to determine what it is for postrgres… I think you’ll get it.

Ok now what? Well, if it says it’s not running… run it! Remember how the command to check it’s status ended in status? I think you see where I’m goign with this. Again, the tab key will help you here.

If it says that postgres is running, then we’ll have to do some set up involving the postgres user and setting up pg roles.

See how this first attempt works out for you, and if you are at a point where you can confirm posgres is running and you still get this error, ping me again and we’ll keep going.