kali的psql无法启动是什么原因

之前用的一直很正常,直到昨天我重新打开了一下armitage的时候发现无法链接psql了,我就去看了下msf,发现数据的链接出现了异常:

msf5 > db_status 
[*] postgresql selected, no connection

然后我就重新刷新了一下数据库信息,给我报了一大堆的错误:

[i] Database already started
psql: 错误: 无法连接到服务器:无法联接到服务器: 没有那个文件或目录
	服务器是否在本地运行并且在 Unix 域套接字
	"/var/run/postgresql/.s.PGSQL.5432"上准备接受联接?
psql: 错误: 无法连接到服务器:无法联接到服务器: 没有那个文件或目录
	服务器是否在本地运行并且在 Unix 域套接字
	"/var/run/postgresql/.s.PGSQL.5432"上准备接受联接?
psql: 错误: 无法连接到服务器:无法联接到服务器: 没有那个文件或目录
	服务器是否在本地运行并且在 Unix 域套接字
	"/var/run/postgresql/.s.PGSQL.5432"上准备接受联接?
[+] Deleting configuration file /usr/share/metasploit-framework/config/database.yml
[+] Stopping database
[+] Starting database
psql: 错误: 无法连接到服务器:无法联接到服务器: 没有那个文件或目录
	服务器是否在本地运行并且在 Unix 域套接字
	"/var/run/postgresql/.s.PGSQL.5432"上准备接受联接?
[+] Creating database user 'msf'
psql: 错误: 无法连接到服务器:无法联接到服务器: 没有那个文件或目录
	服务器是否在本地运行并且在 Unix 域套接字
	"/var/run/postgresql/.s.PGSQL.5432"上准备接受联接?
[+] Creating databases 'msf'
createdb: 错误: 无法联接到数据库 template1: 无法联接到服务器: 没有那个文件或目录
	服务器是否在本地运行并且在 Unix 域套接字
	"/var/run/postgresql/.s.PGSQL.5432"上准备接受联接?
psql: 错误: 无法连接到服务器:无法联接到服务器: 没有那个文件或目录
	服务器是否在本地运行并且在 Unix 域套接字
	"/var/run/postgresql/.s.PGSQL.5432"上准备接受联接?
[+] Creating databases 'msf_test'
createdb: 错误: 无法联接到数据库 template1: 无法联接到服务器: 没有那个文件或目录
	服务器是否在本地运行并且在 Unix 域套接字
	"/var/run/postgresql/.s.PGSQL.5432"上准备接受联接?
[+] Creating configuration file '/usr/share/metasploit-framework/config/database.yml'
[+] Creating initial database schema
rake aborted!
PG::ConnectionBad: could not connect to server: Connection refused
	Is the server running on host "localhost" (::1) and accepting
	TCP/IP connections on port 5432?
could not connect to server: Connection refused
	Is the server running on host "localhost" (127.0.0.1) and accepting
	TCP/IP connections on port 5432?
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/connection_handling.rb:87:in `connection'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/migration.rb:941:in `initialize'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/migration.rb:823:in `new'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/migration.rb:823:in `up'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/migration.rb:801:in `migrate'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/tasks/database_tasks.rb:139:in `migrate'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activerecord-4.2.11.1/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

其实最关键的是这个问题,导致我现在就是打都打不开psql新建账户啥的都有问题了:

psql: 错误: 无法连接到服务器:无法联接到服务器: 没有那个文件或目录
	服务器是否在本地运行并且在 Unix 域套接字
	"/var/run/postgresql/.s.PGSQL.5432"上准备接受联接?

有没有大佬知道这个问题如何解决?
如果实在不行的话呢我只能恢复镜像了,但是太多东西都就没了...

postgresql的服务起了?

老哥我折腾好了 :nerd_face:,原因其实挺简单的