<div dir="ltr">Hi Tatsuo,<div><br></div><div>I think it's not a big problem but, as you say, I think it would be nice to have this fixed someday.  </div><div><br></div><div>Thank you very much for the information and your time.</div><div><br></div><div>Best regards,</div><div><br></div><div>Camilo <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-11 5:23 GMT-03:00 Tatsuo Ishii <span dir="ltr"><<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Camilo,<br>
<br>
Good question:-) Because pgpool main/child process does not modify the<br>
file, yes, the write permission is not necessary for the process. It's<br>
just because of sloppy implementation which shares the code between<br>
pgpool and pg_md5 (pg_md5 needs write privilege). We should fix it<br>
someday.<br>
<div class="HOEnZb"><div class="h5"><br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
<br>
> Hello Tatsuo,<br>
><br>
> Thank you very much, that did the trick! I think I was assuming that the<br>
> "open" message error on the log was only to read the file, not to write to<br>
> it.<br>
><br>
> With the aim to contribute, may I ask why the process needs write<br>
> permission to pool_passwd file? I'm a little bit curious since in my mind<br>
> the less permissions a process needs the better and I just can't think why<br>
> should it need to write to that file.<br>
><br>
> Thank you very much again for your help and kind response.<br>
><br>
> Best regards,<br>
><br>
> Camilo<br>
><br>
><br>
> 2015-03-10 19:31 GMT-03:00 Tatsuo Ishii <<a href="mailto:ishii@postgresql.org">ishii@postgresql.org</a>>:<br>
><br>
>> You need write permission of pool_passwd for pgpool process.<br>
>><br>
>> Best regards,<br>
>> --<br>
>> Tatsuo Ishii<br>
>> SRA OSS, Inc. Japan<br>
>> English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
>> Japanese:<a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
>><br>
>> > Hi all,<br>
>> ><br>
>> > I'm currently having trouble with md5 auth on my current configuration,<br>
>> and<br>
>> > having looked everywhere with no luck I'm now asking for some help.<br>
>> ><br>
>> > I was already able to use pgpool using "trust" auth mode on pgpool and<br>
>> > backends but when switching to md5 mode I'm unable to login as the<br>
>> > following error message appears:<br>
>> ><br>
>> > psql: ERROR:  "MD5" authentication with pgpool failed for user "postgres"<br>
>> ><br>
>> > Looking at pgpool logs I found the following interesting lines:<br>
>> ><br>
>> > (when booting pgpool):<br>
>> ><br>
>> > pool_init_pool_passwd: couldn't open /etc/pgpool2/pool_passwd. reason:<br>
>> > Permission denied<br>
>> ><br>
>> > (Later, when trying to connect):<br>
>> > pool_init_pool_passwd: couldn't open /etc/pgpool2/pool_passwd. reason:<br>
>> > Permission denied<br>
>> > pool_get_passwd: passwd_fd is NULL<br>
>> > "MD5" authentication with pgpool failed for user "postgres"<br>
>> ><br>
>> > I double checked pgpool.cong, pool_hba.conf and pool_passwd and<br>
>> everything<br>
>> > looked fine. Trying some brute-force I run pgpool as the root user and<br>
>> md5<br>
>> > auth works OK. Given this, I supposed the issue was with file permissions<br>
>> > but I checked pool_passwd and was readable by the postgres user, which is<br>
>> > whom own the pgpool process when md5 auth doesn't work (I'm running<br>
>> pgpool<br>
>> > as a "service" on Debian wheezy via /etc/init.d/pgpool start). I tried to<br>
>> > confirm again that the postgres user is able to read pool_passwd and<br>
>> doing<br>
>> > a "sudo su -c 'cat /etc/pgpool2/pool_passwd' postgres" works ok.<br>
>> ><br>
>> > TL;DR: When running pgpool as root md5 auth works, when not, md5 auth<br>
>> > doesn't and pgpool complains "permission_denied" to pool_passwd despite<br>
>> > having access to it.<br>
>> ><br>
>> > Could anyone tell me please if I am missing something? Is there a way to<br>
>> > debug this? BTW I'm using pgpool provided by pgdg apt repository (<br>
>> > <a href="https://wiki.postgresql.org/wiki/Apt" target="_blank">https://wiki.postgresql.org/wiki/Apt</a>)<br>
>> ><br>
>> > Thanks!<br>
>> ><br>
>> > Camilo<br>
>><br>
</div></div></blockquote></div><br></div>