Cannot start postgreSQL, attached error log

322 Views Asked by At

Can't start the postgreSQL service, I performed my first install today by running:

sudo apt-get install postgresql postgresql-contrib

Got the following output:

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)

I have tried to manually change the settings on the file it tells me is the cause of the erro in order for it to have only root access, to no avail. Does anyone have any sugestions as to what might be a good idea to get it working?

Thanks in advance.

1

There are 1 best solutions below

0
On

user Joop answered this question really easily. I thank him for that. here's his answer.

chown postgres /etc/ssl/private/ssl-cert-snakeoil.key; chmod 640 /etc/ssl/private/ssl-cert-snakeoil.key (according to the message, owner root would also work; and IMHO, file mode 400 or 440 would be better.