Sep 09 2005

PostgreSQL won’t start after a Hard Reboot reboot

Tag:markmaldony @ 23:04

My penguincares database was not starting after I did a major
reboot of my server. I pressed the power off and the computer
went down but postgres never came back. I figured something had
to happen after the reboot. I started the server using the /etc/init.d/postgres
script but it did not started. I found the solution online and as I had
suspected it was the wrong pid that needed to be deleted and recreated by the
init script.

:)

Take care faithfull penguin readers


After the system crash (reboot) the PostgreSQL server does not start because PID
file /var/lib/pgsql/data/postmaster.pid is not removed by initscripts at the
startup sequence. This is not a fault of initscripts but this is a bug in the
default PostgreSQL configuration.

The PostgreSQL server should have only one PID file in
/var/run/postmaster. .pid or the second PID file in /var/run/postgresql
subdirectory. After this relocation, initscripts should be fixed (postgresql
directory added, see line 943 in /etc/rc.d/rc.sysinit).

This is a very anoying longstandig bug so please make a REAL fix. When the
service does not start after the reboot (when NO other posmaster is able to run)
I think something is wrong in the bix complecity of /etc/init.d/postgresql. Also
I’m wondering why the hell there are two different same PID files…