--- postgresql-7.4.2/src/bin/pg_ctl/pg_ctl.sh.orig Fri Mar 26 15:54:46 2004 +++ postgresql-7.4.2/src/bin/pg_ctl/pg_ctl.sh Fri Mar 26 16:04:50 2004 @@ -98,12 +98,12 @@ fi # Check if needed programs actually exist in path -if [ -x "$self_path/postmaster" ] && [ -x "$self_path/psql" ]; then +if [ -x "$self_path/postmaster" ]; then PGPATH="$self_path" -elif [ -x "$bindir/postmaster" ] && [ -x "$bindir/psql" ]; then +elif [ -x "$bindir/postmaster" ]; then PGPATH="$bindir" else - echo "The programs \"postmaster\" and \"psql\" are needed by $CMDNAME but" 1>&2 + echo "The programs \"postmaster\" is needed by $CMDNAME but" 1>&2 echo "were not found in the directory \"$bindir\"." 1>&2 echo "Check your installation." 1>&2 exit 1 @@ -384,7 +384,8 @@ $silence_echo $ECHO_N "waiting for postmaster to start..."$ECHO_C while : do - if "$PGPATH/psql" -p $PGPORT -l >/dev/null 2>&1 + # YES, this is horribly misconceived. + if ps ax | grep -q "[p]ostmaster -D $PGDATA" >/dev/null 2>&1 then break; else