Make SIGHUP less painful if pg_hba.conf is not readable

From: Selena Deckelmann <selena(at)endpoint(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Make SIGHUP less painful if pg_hba.conf is not readable
Date: 2009-03-04 01:54:54
Message-ID: 49ADDF6E.5080903@endpoint.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


This is my first patch. I hope it's not stupid.

We ran into a little issue today where permission/ownership on
pg_hba.conf was accidentally changed to something that the postgres user
could not read. When a SIGHUP was issued, the postmaster quit. That was
kind of a bummer.

From the comment in hba.c, it appears that the desired behavior is to
have the system ignore the failure, and continue using what's already
loaded into memory. And, turns out, that's what I would like Postgres
to do as well.

So, this patch changes the error issued from load_hba() from FATAL to
WARNING if the file is not found, and returns.

Startup behavior (FATAL if pg_hba.conf can't be found) is not changed.

Tested against 8.4devel HEAD today.

Patch attached.

--
Selena Deckelmann
End Point Corporation
selena(at)endpoint(dot)com

Attachment Content-Type Size
less_mean_hba_v1.patch text/plain 612 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2009-03-04 02:06:43 Re: Immediate shutdown and system(3)
Previous Message xuan--2009.03--submitbug--support--postgresql.org 2009-03-04 01:37:10 BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite