1. 程式人生 > >FATAL: could not create lock file “postmaster.pid”: Permission denied

FATAL: could not create lock file “postmaster.pid”: Permission denied

1.環境
系統:Ubuntu 14.04.5 LTS
DB:(PostgreSQL) 9.3.24

2.異常現象 :
*Starting PostgreSQL 9.3 database server
*Removed stale pid file.
The PostgreSQL server failed to start. Please check the log output:
2018-08-30 09:29:07 CST FATAL: could not remove old lock file “postmaster.pid”: Permission denied
2018-08-30 09:29:07 CST HINT: The file seems accidentally left over, but it could not be removed. Please remove the file by hand and try again.
在這裡插入圖片描述


3.解決方式:
找到這個檔案所在的目錄,並刪除 postmaster.pid 檔案:
在這裡插入圖片描述
然後修改/var/lib/postgresql/9.3/main的許可權,,重啟postgresql服務即可:
在這裡插入圖片描述
所有改解決方案截圖:
在這裡插入圖片描述