PostgreSQL 启动失败
* Starting PostgreSQL 9.1 database server * Removed stale pid file.The PostgreSQL server failed to start. Please check the log output:
2015-03-05 15:41:57 GMT FATAL:could not remove old lock file "postmaster.pid": Operation not permitted
2015-03-05 15:41:57 GMT HINT:The file seems accidentally left over, but it could not be removed. Please remove the file by hand and try again.
解决方式:
root@db38bdb26696: /var/lib/postgresql/9.1/main# ls
PG_VERSIONbaseglobalpg_clogpg_multixactpg_notifypg_serialpg_stat_tmppg_subtranspg_tblspcpg_twophasepg_xlogpostmaster.optspostmaster.pidserver.crtserver.key
删除 postmaster.pid
rm postmaster.pid
root@db38bdb26696:/var/run/postgresql# ll
total 16
drwxrwsr-x2 postgres postgres 4096 Mar5 23:43 ./
drwxr-xr-x 11 root root 4096 Feb9 15:10 ../
srwxrwxrwx1 postgres postgres 0 Mar5 23:43 .s.PGSQL.5432=
-rw-------1 postgres postgres 70 Mar5 23:43 .s.PGSQL.5432.lock
-rw-------1 postgres postgres 5 Mar5 23:43 9.1-main.pid
删除 .s.PGSQL.5432= 和 .s.PGSQL.5432.lock
再重启动就ok了
sudo /etc/init.d/postgresql start
* Starting PostgreSQL 9.1 database server
页:
[1]