几天来我一直在尝试让 postgresql 工作,并且在重新启动之前它短暂地工作了。如何设置正确的权限?这是我在重新启动后尝试启动服务时收到的错误。
root@kali:~# service postgresql start
[....] Starting PostgreSQL 9.1 database server: main[....] The PostgreSQL server failed to start. Please check the log output:
2015-05-24 08:51:21 UTC LOG: database system was interrupted; last known up at 2015-05-24 07:33:08 UTC
2015-05-24 08:51:22 UTC FATAL: could not open file "/etc/ssl/certs/ssl-cert-snakeoil.pem": Permission denied
2015-05-24 08:51:22 UTC LOG: startup process (PID 2505) exited with exit code 1
2[FAIL5-24 08:51:22 UTC LOG: aborting startup due to startup process failure ... failed!
failed!
我已阅读有关该主题的所有相关帖子,它们没有解决我的问题,所以这是不同的。我不知道具体如何,我可以提供所需的任何额外信息。
答案1
我遇到了同样的问题并设法通过以下方式解决它:
cd /etc/ssl/certs/
chown postgres ssl-cert-snakeoil.pem
chmod 777 ssl-cert-snakeoil.pem
cd /etc/ssl/private
chown postgres ssl-cert-snakeoil.key
chmod 700 ssl-cert-snakeoil.key