无法启动postgreSQL服务,我今天通过运行:
执行了我的第一次安装sudo apt-get install postgresql postgresql-contrib
得到以下输出:
Reading package lists... Done
Building dependency tree
Reading state information... Done
postgresql is already the newest version.
postgresql-contrib is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 28 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up postgresql-9.4 (9.4.2-0ubuntu0.14.10) ...
* Starting PostgreSQL 9.4 database server * The PostgreSQL server failed to start. Please check the log output:
2015-06-15 10:25:25 MDT [18101-1] FATAL: private key file "/etc/ssl/private/ssl-cert-snakeoil.key" has group or world access
2015-06-15 10:25:25 MDT [18101-2] DETAIL: File must be owned by the database user or root, must have no write permission for "group", and must have no permissions for "other".
[fail]
invoke-rc.d: initscript postgresql, action "start" failed.
dpkg: error processing package postgresql-9.4 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql:
postgresql depends on postgresql-9.4; however:
Package postgresql-9.4 is not configured yet.
dpkg: error processing package postgresql (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-contrib-9.4:
postgresql-contrib-9.4 depends on postgresql-9.4 (= 9.4.2-0ubuntu0.14.10); however:
Package postgresql-9.4 is not configured yet.
dpkg: error processing package postgresql-contrib-9.4 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-contrib:
postgresql-contrib depends on postgresql-contrib-9.4; however:
Package postgresql-contrib-9.4 is not configured yet.
dpkg: error processing package postgresql-contrib (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because MaxReports is reached already
Errors were encountered while processing:
postgresql-9.4
postgresql
postgresql-contrib-9.4
postgresql-contrib
E: Sub-process /usr/bin/dpkg returned an error code (1)
我试图手动更改文件上的设置,它告诉我是erro的原因,以便它只有root访问权限,但无济于事。有没有人知道什么可能是一个好主意让它运作?
提前致谢。
答案 0 :(得分:0)
chown postgres /etc/ssl/private/ssl-cert-snakeoil.key; chmod 640 /etc/ssl/private/ssl-cert-snakeoil.key(根据消息,所有者root也可以工作;而恕我直言,文件模式400或440会更好。