gpt4 book ai didi

Postgresql 9.5 安装 - 配置所有者(postgres :105) and data owner (ubuntu:1000) do not match, 和配置所有者不是 root

转载 作者:行者123 更新时间:2023-11-29 11:42:44 24 4
gpt4 key购买 nike

ubuntu 14.04 上安装 postgres9.5 时,以下命令因错误而停止: $sudo apt-get install postgresql-9.5 pgadmin3

这是错误信息:

 Preparing to unpack .../postgresql-9.5_9.5.4-1.pgdg14.04+2_amd64.deb ...
* Stopping PostgreSQL 9.5 database server * Error: Config owner (postgres:105) and data owner (ubuntu:1000) do not match, and config owner is not root
[fail]
invoke-rc.d: initscript postgresql, action "stop" failed.
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
* Stopping PostgreSQL 9.5 database server * Error: Config owner (postgres:105) and data owner (ubuntu:1000) do not match, and config owner is not root
[fail]
invoke-rc.d: initscript postgresql, action "stop" failed.
dpkg: error processing archive /var/cache/apt/archives/postgresql-9.5_9.5.4-1.pgdg14.04+2_amd64.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/postgresql-9.5_9.5.4-1.pgdg14.04+2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

错误的原因是什么?

最佳答案

我今天遇到了同样的问题,我认为它的发生是因为我不小心做了一个(递归)更改所有权的目录太高(修复痛苦的错误)。

systemd[1]: Starting PostgreSQL Cluster 10-main...                                                                                         
postgresql@10-main[3231]: Error: Config owner (postgres:111) and data owner (root:0) do not match, and config owner is not root
systemd[1]: postgresql@10-main.service: Can't open PID file /var/run/postgresql/10-main.pid (yet?) after start: No such file or directory
systemd[1]: postgresql@10-main.service: Failed with result 'protocol'.
systemd[1]: Failed to start PostgreSQL Cluster 10-main.

为了解决这个问题,我确保数据也由特殊用户 postgres 拥有,如下所示:

cd /var/lib/
chown -R postgres postgresql/

之后,(以 root 身份)启动主服务正常工作:

start postgresql@10-main
root@myhost:/var/lib/postgresql# systemctl status postgresql@10-main.service
● postgresql@10-main.service - PostgreSQL Cluster 10-main
Loaded: loaded (/lib/systemd/system/postgresql@.service; indirect; vendor preset: enabled)
Active: active (running) since Tue 2018-05-15 07:34:30 UTC; 4s ago
Process: 3333 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 10-main start (code=exited, status=0/SUCCESS)
Main PID: 3347 (postgres)
Tasks: 7 (limit: 1112)
CGroup: /system.slice/system-postgresql.slice/postgresql@10-main.service
├─3347 /usr/lib/postgresql/10/bin/postgres -D /var/lib/postgresql/10/main -c config_file=/etc/postgresql/10/main/postgresql.conf
├─3355 postgres: 10/main: checkpointer process
├─3356 postgres: 10/main: writer process
├─3357 postgres: 10/main: wal writer process
├─3358 postgres: 10/main: autovacuum launcher process
├─3359 postgres: 10/main: stats collector process
└─3360 postgres: 10/main: bgworker: logical replication launcher

关于Postgresql 9.5 安装 - 配置所有者(postgres :105) and data owner (ubuntu:1000) do not match, 和配置所有者不是 root,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39983732/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com