"pg_ctl -w" does not return a failure exit code when postmaster fails to start

Started by Steve McWilliamsover 21 years ago2 messagesbugs
Jump to latest
#1Steve McWilliams
smcwilliams@EmprisaNetworks.com

I have noticed on linux that if you try to start postmaster via "pg_ctl
-w", but the postmaster fails to run (e.g. if you forgot to create
PGDATA), it returns a 0 exit code. It needs to return a non-0 exit code
if postmaster failed to start, when you are using the "-w" option to wait
for it to start.

Thanks,
Steve McWilliams

#2Bruce Momjian
bruce@momjian.us
In reply to: Steve McWilliams (#1)
Re: [BUGS] "pg_ctl -w" does not return a failure exit code when postmaster

Steve McWilliams wrote:

I have noticed on linux that if you try to start postmaster via "pg_ctl
-w", but the postmaster fails to run (e.g. if you forgot to create
PGDATA), it returns a 0 exit code. It needs to return a non-0 exit code
if postmaster failed to start, when you are using the "-w" option to wait
for it to start.

OK, this small applied patch fixes the problem. pg_ctl.c is a new file
in 8.0 so we didn't hit all the return values correctly on our first
try.

-- 
  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

Attachments:

/bjm/difftext/plainDownload+3-0