前提・実現したいこと
プログラミング初学者です。現場で使えるRuby on Rails5速習実践ガイドに沿って勉強しています。
postgresqlが起動できません。
production環境でアプリケーション立ち上げるという部分でエラーがでて、さらに今まで起動していたpostgresqlが起動できなくなりました。起動の解決方法を教えて頂きたいです。
発生している問題・エラーメッセージ
kei@DESKTOP-KLC2EKF:~$ sudo service postgresql start [sudo] password for kei: * Starting PostgreSQL 12 database server * Error: /usr/lib/postgresql/12/bin/pg_ctl /usr/lib/postgresql/12/bin/pg_ctl start -D /var/lib/postgresql/12/main -l /var/log/postgresql/postgresql-12-main.log -s -o -c config_file="/etc/postgresql/12/main/postgresql.conf" exited with status 1: 2020-08-16 11:22:23.874 JST [107] LOG: starting PostgreSQL 12.3 (Ubuntu 12.3-1.pgdg18.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit 2020-08-16 11:22:23.906 JST [107] LOG: listening on IPv4 address "127.0.0.1", port 5432 2020-08-16 11:22:23.914 JST [107] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2020-08-16 11:22:24.257 JST [107] LOG: could not open configuration file "/etc/postgresql/12/main/pg_hba.conf": Permission denied 2020-08-16 11:22:24.257 JST [107] FATAL: could not load pg_hba.conf 2020-08-16 11:22:24.269 JST [107] LOG: database system is shut down pg_ctl: could not start server Examine the log output.
試したこと
pg_hba.conf": Permission deniedとでていたのでパーミッションを変更しようとしましたが、chmod: changing permissions of 'pg_hba.conf': Operation not permittedとでてしまいます。
==
kei@DESKTOP-KLC2EKF:/etc/postgresql/12/main$ ls -l
total 40
drwxr-xr-x 1 postgres postgres 4096 Aug 10 00:55 conf.d
-rw-r--r-- 1 postgres postgres 315 Aug 10 00:55 environment
-rw-r--r-- 1 postgres postgres 143 Aug 10 00:55 pg_ctl.conf
---------- 1 postgres postgres 4686 Aug 13 15:21 pg_hba.conf
-rw-r----- 1 postgres postgres 1636 Aug 10 00:55 pg_ident.conf
-rw-r--r-- 1 postgres postgres 26791 Aug 10 00:55 postgresql.conf
-rw-r--r-- 1 postgres postgres 317 Aug 10 00:55 start.conf
kei@DESKTOP-KLC2EKF:/etc/postgresql/12/main$ chmod 766 pg_hba.conf
chmod: changing permissions of 'pg_hba.conf': Operation not permitted
補足情報(FW/ツールのバージョンなど)
ruby 2.5.8
Rails 5.2.4.3
Ubuntu 18.04 LTS

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/08/16 03:20
2020/08/16 03:31
2020/08/16 04:11