artix에서 runit을 사용하여 postgresql을 시작한 후 문제가 발생합니다.
#sudo sv start postgresql
ok: run: postgresql: (pid 849) 1236s
#sudo -u postgres psql
psql: error: connection to server on socket "/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
#sudo sv status postgresql
down: postgresql: 0s, normally up, want up; run: log: (pid 854) 1273s
주로 시작되고 상태를 확인한 후 서비스가 다운되었다는 메시지가 나타납니다.
sudo sv start postgresql
ok: run: postgresql: (pid 11583) 0s
sudo sv status postgresql
down: postgresql: 0s, normally up, want up; run: log: (pid 854) 59
/var/log/postgresql/@400000006611a7623ac93f6c.u
2024-04-06_19:09:52.09176 postgres: could not access the server configuration file "/var/lib/postgres/data/postgresql.conf": No such file or directory
수동으로 시작할 때:
➜ postgresql sudo ./run
2024-04-07 21:21:42.964 GMT [19108] LOG: skipping missing configuration file "/var/lib/postgres/data/postgresql.auto.conf"
2024-04-07 21:21:42.964 GMT [19108] FATAL: "/var/lib/postgres/data" is not a valid data directory
2024-04-07 21:21:42.964 GMT [19108] DETAIL: File "/var/lib/postgres/data/PG_VERSION" is missing.
답변1
고치다
#FATAL: "/var/lib/postgres/data" is not a valid data directory
rm /var/lib/postgres/data
sv start postgresql