[pgpool-general: 1368] Re: md5 auth only works when I start pgpool with "-n"

Tatsuo Ishii ishii at postgresql.org
Mon Feb 4 14:57:07 JST 2013


> On Feb 3, 2013, at 8:39 PM, Tatsuo Ishii <ishii at postgresql.org> wrote:
> 
>>> On Feb 3, 2013, at 1:58 AM, Tatsuo Ishii <ishii at postgresql.org> wrote:
>>> 
>>>> From: David Kerr <web at mr-paradox.net>
>>>> Subject: Re: [pgpool-general: 1363] md5 auth only works when I start pgpool with "-n"
>>>> Date: Sat, 2 Feb 2013 20:33:58 -0800
>>>> Message-ID: <80CD5B89-9D55-44CA-8C21-6527C53113CD at mr-paradox.net>
>>>> 
>>>>> On Feb 2, 2013, at 12:57 AM, Tatsuo Ishii <ishii at postgresql.org> wrote:
>>>>> 
>>>>>>> Howdy,
>>>>>>> 
>>>>>>> I believe I ran into this a few months ago and didn't get a resolution. Now I'm back at it and I hope
>>>>>>> that there's an answer.
>>>>>>> 
>>>>>>> Basically, if i start pgpool (streaming replication / pooling mode) with:
>>>>>>> pgpool -nf pgpool.conf
>>>>>>> 
>>>>>>> I can log in just fine via md5 authentication.
>>>>>>> 
>>>>>>> However, If i start it with
>>>>>>> pgpool -f pgpool.conf
>>>>>>> 
>>>>>>> I get: psql: ERROR:  "MD5" authentication with pgpool failed for user "postgres"
>>>>>>> 
>>>>>>> Since it works fine when i don't background it, I have to assume that my
>>>>>>> configuration is correct.
>>>>>>> 
>>>>>>> I can strace the various processes. (attached) 
>>>>>>> master is: pgpool -f pgpool.conf
>>>>>>> worker is: pgpool: worker process
>>>>>>> waiter is: pgpool: wait for connection request
>>>>>>> 
>>>>>>> I'm on pgpool 3.2.1, CentOS.
>>>>>>> 
>>>>>>> Hopefully this one's already been covered quite a bit (although no luck with
>>>>>>> google and reading back mailing list messages).
>>>>>> 
>>>>>> Did not reproduce with master here. However we have fixed
>>>>>> pool_password problem in last October.
>>>>>> 
>>>>>> http://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=8e18fee1663fba81d1e56a77bc6702c6930692a8
>>>>>> 
>>>>>> And this may related to your problem.
>>>>>> 
>>>>>> Can you please try with this patch or the latest 3.2-stable snapshot?
>>>>>> 
>>>>>> http://git.postgresql.org/gitweb/?p=pgpool2.git;a=snapshot;h=45c08c8349f72f72d05775ad58889b46ce8b4cf7;sf=tgz
>>>>>> --
>>>>>> Tatsuo Ishii
>>>>>> SRA OSS, Inc. Japan
>>>>>> English: http://www.sraoss.co.jp/index_en.php
>>>>>> Japanese: http://www.sraoss.co.jp
>>>>>> 
>>>>> 
>>>>> Same problem.
>>>>> 
>>>>> Should I not be starting pgpool as root? would that make any difference?
>>>> 
>>>> I don't think so. BTW, can you show ls -l /proc/fd/waiter_pid? I want
>>>> to make sure that fd (4 your from waiter ptrace) correctly points to
>>>> pool_passwd.
>>> 
>>> good call! it points to /pool_password instead of /usr/local/etc/pool_password
>>> 
>>> If i move my pool_password / it starts to work.
>>> 
>>> is that set somewhere?
>> 
>> In main.c:
>> 
>> 	if (strcmp("", pool_config->pool_passwd))
>> 	{
>> 		char pool_passwd[POOLMAXPATHLEN+1];
>> 		char dirnamebuf[POOLMAXPATHLEN+1];
>> 		char *dirp;
>> 
>> 		strlcpy(dirnamebuf, conf_file, sizeof(dirnamebuf));
>> 		dirp = dirname(dirnamebuf);
>> 		snprintf(pool_passwd, sizeof(pool_passwd), "%s/%s",
>> 				 dirp, pool_config->pool_passwd);
>> 		pool_init_pool_passwd(pool_passwd);
>> 	}
>> 
>> The absolute pass to pool_passwd is set to the one same as pgpool.conf.
> 
> I see. 
> 
> and It does work correctly if i pass the fully qualified path to pgpool.conf

Oh I see now. You started pgpool with "-f relative_path". And if
pgpool starts with daemon mode, it changes current dir to "/". So
pgpool tried to open "/pool_passwd", instead of
"/usr/local/etc/pool_passwd"! I will add this to doc and/or FAQ.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


More information about the pgpool-general mailing list