diff -Nur -x '*.orig' -x '*.rej' smeserver-postgresql-0.0.1/root/etc/rc.d/init.d/pgsql.init mezzanine_patched_smeserver-postgresql-0.0.1/root/etc/rc.d/init.d/pgsql.init --- smeserver-postgresql-0.0.1/root/etc/rc.d/init.d/pgsql.init 2006-06-28 17:04:34.000000000 -0400 +++ mezzanine_patched_smeserver-postgresql-0.0.1/root/etc/rc.d/init.d/pgsql.init 2006-06-28 17:04:15.000000000 -0400 @@ -31,11 +31,15 @@ exit 0 fi -for i in $(seq 1 10) +M="Waiting for postgresql to startup: ." +for i in $(seq 1 30) do - # FIXME - we have a race condition here - if test -e /service/postgresql/supervise/pid + if chpst -u postgres psql -f - template1 < /dev/null 2>/dev/null then + if [ "$M" = "." ] + then + echo + fi exit_value=0 HOME=/root export HOME @@ -59,8 +63,9 @@ done exit $exit_value fi - echo "Waiting for postgresql to startup" >&2 + echo -n $M + M=. sleep 2 done - +echo "Timed out waiting for postgresql to startup" >&2 exit 1 diff -Nur -x '*.orig' -x '*.rej' smeserver-postgresql-0.0.1/root/var/service/postgresql/run mezzanine_patched_smeserver-postgresql-0.0.1/root/var/service/postgresql/run --- smeserver-postgresql-0.0.1/root/var/service/postgresql/run 2006-06-28 17:04:34.000000000 -0400 +++ mezzanine_patched_smeserver-postgresql-0.0.1/root/var/service/postgresql/run 2006-06-28 16:36:40.000000000 -0400 @@ -6,12 +6,12 @@ if [ ! -f ${DATA}/PG_VERSION ] then - echo "*** Initialising postgresql in data directory ${DATA}" - chpst -u postgres /usr/bin/initdb --pgdata=${DATA} if [ -f /home/e-smith/db/pgsql/pgsql.dump ] then /sbin/e-smith/expand-template /etc/e-smith/pgsql/init/00_restore_backup fi + echo "*** Initialising postgresql in data directory ${DATA}" + chpst -u postgres /usr/bin/initdb --pgdata=${DATA} fi echo "*** Starting postgresql on data ${DATA}" exec \