PostgreSQL 服务器无法在 ArchLinux 上启动:致命:无法创建锁文件 »/run/postgresql/.s.PGSQL.5432.lock« [英] PostgreSQL server fails to start on ArchLinux: FATAL: could not create lockfile »/run/postgresql/.s.PGSQL.5432.lock«

查看:65
本文介绍了PostgreSQL 服务器无法在 ArchLinux 上启动:致命:无法创建锁文件 »/run/postgresql/.s.PGSQL.5432.lock«的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Arch 的新手,也是 PostgreSQL 的初学者,所以这可能是一个非常基本的问题.

I am quite new in Arch and a total beginner in PostgreSQL, so this may be a very basic question.

我安装了来自 extra 的 postgresql 11.5-4 和来自 AUR 的 pgadmin 4,两者似乎都运行良好.我使用以下命令创建了一个测试数据库:

I installed postgresql 11.5-4 from extra and pgadmin 4 from AUR, both seem to be running well. I created a test DB with the following command:

initdb -D /home/lg/test-db

我得到了答案:

You can start the db-server using:
pg_ctl -D /home/lg/test-db -l logdatei start

我试过了,结果:

pg_ctl -D /home/lg/test-db -l logdatei start
waiting for serer to start.... stopped 
pg_ctl: could not start the server
check the log.

日志只说无法创建锁文件»/run/postgresql/.s.PGSQL.5432.lock«,因为找不到文件夹./run 下没有名为postgresql"的文件夹.我想 postgresql 不能创建这个文件夹,因为它没有权限.但是,一些在线帖子建议将数据库的用户/所有者更改为 sudo.但是,Postgresql 阻止了这种情况.当我以 sudo 身份尝试任何命令时,postgresql 告诉我该命令不能以 root 身份运行.我这里的想法肯定有一些非常基本的错误,但我已经3个小时没有解决了.

The log only says that the lockfile »/run/postgresql/.s.PGSQL.5432.lock« could not be created, because the folder could not be found. Under /run is no folder called "postgresql". I suppose postgresql can not create this folder, because it does not have the permission. Several posts online posts suggest to change the user/owner of the db to sudo, however. Postgresql prevents this, however. When I try any command as sudo, postgresql tells me that this command can't be run as root. There must be some very basic error in my thinking here, but I have not worked it out for 3 hours.

推荐答案

您必须从 postgresql.conf 中的 unix_socket_directories 中删除 /run/postgresql 在启动服务器之前.

You'll have to remove /run/postgresql from unix_socket_directories in postgresql.conf before starting the server.

这篇关于PostgreSQL 服务器无法在 ArchLinux 上启动:致命:无法创建锁文件 »/run/postgresql/.s.PGSQL.5432.lock«的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆