Problem getting postmaster PID in pg_regress

From: Eric E <whalesuit(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Problem getting postmaster PID in pg_regress
Date: 2006-07-21 16:34:24
Message-ID: 44C10210.3000702@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,
I'm trying to run pg_regress as part of a build of Postgres 8.1 on
Suse Linux Enterprise Server 9. I keep getting the following error:
./pg_regress: line 264: kill: (25049) - No such process

I chased the problem down to the following lines in pg_regress:

"$bindir/postmaster" -D "$PGDATA" -F $postmaster_options
>"$LOGDIR/postmaster.log"; 2>&1 &
postmaster_pid=$!

When I run sh -x pg_regress, I get:
+/usr/src/packages/BUILD/postgresql-8.1.4/src/test/regress/./tmp_check/install//usr/bin/postmaster

\
/usr/src/packages/BUILD/postgresql-8.1.4/src/test/regress/./tmp_check/data
-F -c listen_addresses=
+ postmaster_pid=25049

As I understand it, $! is supposed to return the process id of the last
backgrounded process. However, in my case it's return a process ID 1
greater than the actual postmaster instance. I end up with the
following process tree

25048 ? Ss 0:00
/usr/src/packages/BUILD/postgresql-8.1.4/src/test/regress/./tmp_check/install//usr/bin/postmaster

-D /usr/s
25054 ? S 0:00 \_ postgres: logger process
25056 ? S 0:00 \_ postgres: writer process
25057 ? S 0:00 \_ postgres: stats buffer process
25058 ? S 0:00 \_ postgres: stats collector process

Then of course when the script tries kill -0 on a 25049 to see if the
postmaster came up, it wrongly concludes that postmaster did not start.

Can anyone help understand this behavior and/or get the proper process ID?

Thanks,

Eric

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dan Strömberg 2006-07-21 16:35:37 Re: Column info without executing query
Previous Message Bill Moran 2006-07-21 16:26:02 Re: Impact of vacuum full...