0

I am new to PostgreSQL and stuck on an issue that PostgreSQL isn't starting up. It reported:

FATAL: could not open log file "/path/to/log/filesystem/postgresql-Sun.log": No such file or directory
06:52:32.530 UTC [7440] LOG: database system is shut down

I tried to find the solution online and changed the permission of the postgres user using chown, but that also didn't help or maybe I missed something.

Please advise.

John K. N.
18.9k14 gold badges56 silver badges117 bronze badges
asked Sep 6, 2020 at 7:00

2 Answers 2

1

Make sure that user postgres has "read" (r) and "execute" (x) permissions on all directories on the path, and (additionally) "write" (w) permissions on the last directory.

answered Sep 7, 2020 at 6:21
0

User, which runs postgresql, often postgres, must be able to traverse to this /path/to/log/filesystem/ (often /var/log/postgresql), specified by log_directory config option and be able to write files there. If this path does not exist, you will get No such file or directory error.

You can try switching to this user (e.g. su postgres) and check cd /path/to/log/filesystem (whatever this path really is) and if that throws error, then create the directories (e.g. mkdir -p /path/to/your/log_directory).

There's also a possibility that service manager changes mount points for the service, like systemd is capable of.

answered Sep 6, 2020 at 9:24

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.