-6

I tried to restart Postgres database. Then it shows an error.

 * Starting PostgreSQL 9.5 database server                                                                                                       
 * The PostgreSQL server failed to start. Please check the log output:
   2018-09-04 10:37:05 UTC [2573-1] FATAL:  could not create lock file "postmaster.pid": Permission denied
                                                                                                                                     [fail]

More than 4 applications running on this test server. I need a fix for this issue.

1 Answer 1

1

With an error message such as:

"could not create lock file "postmaster.pid": Permission denied"

I imagine the first thing you did was copying that error message and asking the internet for help.

So please step back, relax, and read the error message - it is quite descriptive.

Then find the directory where postgres writes the PID file. (The external_pid_file = setting from the postgresql.conf.)
And, maybe, just a random thought, check the permissions and ownership of that directory and PID file. Those should be such that the postgres user can write there.
If you installed Postgres on a separate block device, check that it is mounted and writeable.

2
  • first I read the error in detail. This was the first error. * Starting PostgreSQL 9.5 database server * Removed stale pid file. The PostgreSQL server failed to start. Please check the log output: 2018-09-04 10:53:22 UTC [2323-1] FATAL: could not remove old lock file "postmaster.pid": Permission denied 2018-09-04 10:53:22 UTC [2323-2] HINT: The file seems accidentally left over, but it could not be removed. Please remove the file by hand and try again. Sep 4, 2018 at 11:16
  • I removed the pid file. then I landed into this error posted in the question. Sep 4, 2018 at 11:20

Not the answer you're looking for? Browse other questions tagged .