Re: pg_ctl is fragile - Mailing list pgsql-bugs

From Bruce Momjian
Subject Re: pg_ctl is fragile
Date
Msg-id 200211072248.gA7Mm8u15776@candle.pha.pa.us
Whole thread Raw
In response to Re: pg_ctl is fragile  (Neil Conway <neilc@samurai.com>)
List pgsql-bugs
Neil Conway wrote:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
> > Doesn't seem like kill's exit code is going to tell you enough.
> > If you got, say, "Permission denied" rather than "No such process",
> > you shouldn't report that the postmaster isn't running.
>
> Ok, fair enough -- so is there any way to improve this behavior?

Seems we could grab some of kill's stderr and grep it for "No such":

    $ kill -0 32323
    bash: kill: (32323) - No such pid

Probably can't hurt.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-bugs by date:

Previous
From: Neil Conway
Date:
Subject: Re: pg_ctl is fragile
Next
From: "Josh Berkus"
Date:
Subject: Re: Cannot assign ROWTYPE, RECORD variables in PL/pgSQL