Failed to connect to the database: could not connect to server: Connection refused

– kali linux
– metasploit
– Failed to connect to the database: could not connect to server: Connection refused

root@kali:~# service postgresql start
root@kali:~# service metasploit start
root@kali:~# msfconsole

 

#!/usr/bin/env bash

echo 'Start postgresql'
service postgresql start

echo 'Start metasploit'
service metasploit start

echo 'Start msfconsole'
msfconsole