Forum OpenACS Q&A: FYI: Debian Postgres package fix

Collapse
Posted by Jade Rubick on
On the backports mailing list, Andrew Glen-Young fixed a problem that I also was having with Postgres not restarting.

This is /etc/init.d/postgresql

--- postgresql-orig Thu Mar 31 13:46:41 2005
+++ postgresql Thu Mar 31 14:08:12 2005
@@ -35,6 +35,13 @@
# done in postgresql-startup
/usr/share/postgresql/startup-checks-root.sh

+ if [ -f "$PGDATA/postmaster.pid" ]; then
+ PID=`head -n 1 "$PGDATA/postmaster.pid"`
+ if ! ps ax | grep "$PID" | grep -q "$POSTMASTER"; then
+ rm -f "$PGDATA/postmaster.pid"
+ fi
+ fi
+
ERRMSG=$(/sbin/start-stop-daemon --pidfile $PGDATA/postmaster.pid --oknodo --chuid postgres --startas $PG_STARTUP --start 2>&1)

if [ $? != 0 ]; then