when does postgresql read from pg_hba.conf ??

when does postgresql read from pg_hba.conf ??

am 26.04.2010 09:10:03 von Julius Tuskenis

This is a multi-part message in MIME format.
--------------050004070109010003000505
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hello, list

from the postgresql documentation I know, that "The pg_hba.conf file is
read on start-up and when the main server process receives a SIGHUP
signal. If you edit the file on an active system, you will need to
signal the server (using pg_ctl reload or kill -HUP) to make it re-read
the file."

But there have been an incident this Saturday that indicates, that these
are not the only triggers for reading pg_hba.conf. One of our clients
edited pg_hba.conf that day (not correctly I must add), but neither
restarted nor reloaded the postgresql (logs below confirm that). Anyway
at some point the system started using the newly edited file causing
some problems. What could cause the pg_hba.conf to be read by postgresql ?

OS: Win XP SP3
DB: Postgresql 8.3

The log (from pg_log):
2010-04-24 13:49:43 EEST LOG: loaded library
"$libdir/plugins/plugin_debugger.dll"
2010-04-24 13:51:07 EEST LOG: loaded library
"$libdir/plugins/plugin_debugger.dll"
2010-04-24 13:52:31 EEST LOG: loaded library
"$libdir/plugins/plugin_debugger.dll"
2010-04-24 13:53:54 EEST LOG: loaded library
"$libdir/plugins/plugin_debugger.dll"
2010-04-24 13:55:22 EEST LOG: loaded library
"$libdir/plugins/plugin_debugger.dll"
2010-04-24 13:56:45 EEST LOG: loaded library
"$libdir/plugins/plugin_debugger.dll"
2010-04-24 13:57:38 EEST LOG: loaded library
"$libdir/plugins/plugin_debugger.dll"
2010-04-24 13:57:38 EEST LOG: invalid IP mask "md5" in file "C:/Program
Files/PostgreSQL/8.3/data/pg_hba.conf" line 72: Unknown host
2010-04-24 13:57:38 EEST FATAL: missing or erroneous pg_hba.conf file
2010-04-24 13:57:38 EEST HINT: See server log for details.
2010-04-24 13:57:46 EEST LOG: loaded library
"$libdir/plugins/plugin_debugger.dll"
2010-04-24 13:57:46 EEST LOG: invalid IP mask "md5" in file "C:/Program
Files/PostgreSQL/8.3/data/pg_hba.conf" line 72: Unknown host
2010-04-24 13:57:46 EEST FATAL: missing or erroneous pg_hba.conf file
2010-04-24 13:57:46 EEST HINT: See server log for details.
2010-04-24 13:58:05 EEST LOG: loaded library
"$libdir/plugins/plugin_debugger.dll"
2010-04-24 13:59:28 EEST LOG: loaded library
"$libdir/plugins/plugin_debugger.dll"
2010-04-24 13:59:58 EEST LOG: loaded library
"$libdir/plugins/plugin_debugger.dll"

--
Julius Tuskenis
Programavimo skyriaus vadovas
UAB nSoft
mob. +37068233050


--------------050004070109010003000505
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable








Hello, list



from the postgresql documentation I know, that " class=3D"Apple-style-span"
style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: 'T=
imes New Roman'; font-style: normal; font-variant: normal; font-weight: n=
ormal; letter-spacing: normal; line-height: normal; orphans: 2; text-inde=
nt: 0px; text-transform: none; white-space: normal; widows: 2; word-spaci=
ng: 0px; font-size: medium;"> class=3D"Apple-style-span"
style=3D"font-family: verdana,sans-serif; font-size: 12px; line-height: =
18px; text-align: left;">The class=3D"Apple-converted-space">  style=3D"font-size: 1.4em;">pg_hba.conf class=3D"Apple-converted-space"> file is read on start-up an=
d
when the main server process receives a class=3D"Apple-converted-space"> =
SIGHUP
name=3D"AEN23296">  >signal.
If you edit the file on an active system, you will need to signal the
server (using  class=3D"LITERAL" style=3D"font-size: 1.4em;">pg_ctl reload class=3D"Apple-converted-space"> 
or class=3D"Apple-converted-space">  style=3D"font-size: 1.4em;">kill -HUP) to make it re-read the file.=
"



But there have been an incident this Saturday that indicates, that
these are not the only triggers for reading pg_hba.conf. One of our
clients edited pg_hba.conf that day (not correctly I must add), but
neither restarted nor reloaded the postgresql (logs below confirm
that). Anyway at some point the system started using the newly edited
file causing some problems. What could cause the pg_hba.conf to be read
by postgresql ?



OS: Win XP SP3

DB: Postgresql 8.3



The log (from pg_log):

2010-04-24 13:49:43 EEST LOG:  loaded library
"$libdir/plugins/plugin_debugger.dll"

2010-04-24 13:51:07 EEST LOG:  loaded library
"$libdir/plugins/plugin_debugger.dll"

2010-04-24 13:52:31 EEST LOG:  loaded library
"$libdir/plugins/plugin_debugger.dll"

2010-04-24 13:53:54 EEST LOG:  loaded library
"$libdir/plugins/plugin_debugger.dll"

2010-04-24 13:55:22 EEST LOG:  loaded library
"$libdir/plugins/plugin_debugger.dll"

2010-04-24 13:56:45 EEST LOG:  loaded library
"$libdir/plugins/plugin_debugger.dll"

2010-04-24 13:57:38 EEST LOG:  loaded library
"$libdir/plugins/plugin_debugger.dll"

2010-04-24 13:57:38 EEST LOG:  invalid IP mask "md5" in file
"C:/Program Files/PostgreSQL/8.3/data/pg_hba.conf" line 72: Unknown host<=
br>
2010-04-24 13:57:38 EEST FATAL:  missing or erroneous pg_hba.conf fi=
le

2010-04-24 13:57:38 EEST HINT:  See server log for details.

2010-04-24 13:57:46 EEST LOG:  loaded library
"$libdir/plugins/plugin_debugger.dll"

2010-04-24 13:57:46 EEST LOG:  invalid IP mask "md5" in file
"C:/Program Files/PostgreSQL/8.3/data/pg_hba.conf" line 72: Unknown host<=
br>
2010-04-24 13:57:46 EEST FATAL:  missing or erroneous pg_hba.conf fi=
le

2010-04-24 13:57:46 EEST HINT:  See server log for details.

2010-04-24 13:58:05 EEST LOG:  loaded library
"$libdir/plugins/plugin_debugger.dll"

2010-04-24 13:59:28 EEST LOG:  loaded library
"$libdir/plugins/plugin_debugger.dll"

2010-04-24 13:59:58 EEST LOG:  loaded library
"$libdir/plugins/plugin_debugger.dll"

--=20
Julius Tuskenis
Programavimo skyriaus vadovas
UAB nSoft
mob. +37068233050




--------------050004070109010003000505--

Re: when does postgresql read from pg_hba.conf ??

am 26.04.2010 17:38:51 von Alvaro Herrera

Julius Tuskenis wrote:
> Hello, list
>
> from the postgresql documentation I know, that "The pg_hba.conf file
> is read on start-up and when the main server process receives a
> SIGHUP signal. If you edit the file on an active system, you will
> need to signal the server (using pg_ctl reload or kill -HUP) to make
> it re-read the file."
>
> But there have been an incident this Saturday that indicates, that
> these are not the only triggers for reading pg_hba.conf. One of our
> clients edited pg_hba.conf that day (not correctly I must add), but
> neither restarted nor reloaded the postgresql (logs below confirm
> that). Anyway at some point the system started using the newly
> edited file causing some problems. What could cause the pg_hba.conf
> to be read by postgresql ?

Hmm, isn't the file read every time a backend starts on Windows?
This would explain the problem if the file was edited between 13:56:45
and 13:57:38.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: when does postgresql read from pg_hba.conf ??

am 26.04.2010 17:53:03 von Julius Tuskenis

Hello, Alvaro Herrera

2010.04.26 18:38, Alvaro Herrera rašė:
> Hmm, isn't the file read every time a backend starts on Windows?
> This would explain the problem if the file was edited between 13:56:45
> and 13:57:38.
>
> =20
Do you want to say that on windows postgresql acts differently? The=20
pg_hba.conf is read each time the client connects to the postgresql ?=20
Why there is nothing about that in documentation ? (Or did I manage to=20
mis this?....)

--=20
Julius Tuskenis
Programavimo skyriaus vadovas
UAB nSoft
mob. +37068233050


--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: when does postgresql read from pg_hba.conf ??

am 26.04.2010 18:33:12 von Alvaro Herrera

Julius Tuskenis wrote:
> Hello, Alvaro Herrera
>=20
> 2010.04.26 18:38, Alvaro Herrera rašė:
> >Hmm, isn't the file read every time a backend starts on Windows?
> >This would explain the problem if the file was edited between 13:56:45
> >and 13:57:38.
> >
> Do you want to say that on windows postgresql acts differently?

Yes.

> The pg_hba.conf is read each time the client connects to the
> postgresql ?

Yes.

> Why there is nothing about that in documentation ? (Or did I
> manage to mis this?....)

I don't know.

--=20
Alvaro Herrera http://www.CommandPrompt.co=
m/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: when does postgresql read from pg_hba.conf ??

am 27.04.2010 08:01:16 von Julius Tuskenis

2010.04.26 19:33, Alvaro Herrera rašė:
>> Do you want to say that on windows postgresql acts differently?
>> =20
> Yes.
> =20
Thank you, Alvaro,
Your answer was a big surprise for me. On the other hand now I at least=20
know there is nothing wrong with postgresql server.

--=20
Julius Tuskenis
Programavimo skyriaus vadovas
UAB nSoft
mob. +37068233050


--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin