0

无法启动 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)

我试图手动更改文件上的设置,它告诉我是错误的原因,以便它只有 root 访问权限,但无济于事。有没有人对让它工作的好主意有什么建议?

提前致谢。

4

1 回答 1

0

用户 Joop 非常轻松地回答了这个问题。我为此感谢他。这是他的答案。

chown postgres /etc/ssl/private/ssl-cert-snakeoil.key; chmod 640 /etc/ssl/private/ssl-cert-snakeoil.key (根据消息,所有者 root 也可以工作;恕我直言,文件模式 400 或 440 会更好。

于 2015-06-15T16:53:04.663 回答