<div dir="ltr">Hi<div><br></div><div>Pgpool-II does not properly handle the relative paths especially when the pgpool.conf file is explicitly specified using the command line (-f switch) while its patch is given relative to the current directory.</div><div><br></div><div>For example:</div><div><br></div><div>Suppose we invoke pgpool-II from &quot;/home/work/installed/pgpool/bin&quot; directory</div><div><br></div><div><font face="monospace, monospace">$ pwd</font></div><div><font face="monospace, monospace">/home/work//installed/pgpool/bin<br></font></div><div><font face="monospace, monospace">$ ./pgpool -f simple_conf/pgpool.conf <br></font></div><div><br></div><div>Now we are expecting here is that the Pgpool-II will look for pgpool.conf file in the </div><div><font face="monospace, monospace">/home/work/installed/pgpool/bin/simple_conf/</font> directory, which it does correctly :-), and also latter in the startup phase when it will require the <font face="monospace, monospace">pool_passwd</font> file it will look in the same (<span style="font-family:monospace,monospace">/home/work/installed/pgpool/bin/simple_conf/</span>)directory.</div><div>So in the code what Pgpool-II does is, it take out the directory portion from the command line option provided to it for specifying the pgpool.conf file and look for the <font face="monospace, monospace">pool_passwd</font> file in that directory. which in this case is just <font face="monospace, monospace">simple_conf/</font></div><div><font face="monospace, monospace"><br></font></div><div>Now the problem here is since the <font face="monospace, monospace">pgpool.conf</font> path used in the command line option was a relative path, so it will only be able to go to the correct directory location if the current directory of Pgpool-II remains the same from where it was invoked from.</div><div><br>And since we do not change the current directory when Pgpool-II is started with &quot;-n&quot; switch ( non daemon mode) so everything works as expected in that mode.</div><div>But when the Pgpool-II is started in the daemon mode the <font face="monospace, monospace">daemonize()</font> function changes the current directory to &quot;/&quot;<br><br><font face="monospace, monospace">main.c:380 if(chdir(&quot;/&quot;))</font></div><div><br></div><div>and after that all relative path becomes invalid and Pgpool-II will start looking for files in invalid or non-existent location. which as per our example in daemon mode it will try to find the pool_passwd file in</div><div><br></div><div><font face="monospace, monospace">/simple_conf/pool_passed</font></div><div><br></div><div>instead of <br></div><div><p class="gmail-p1"><span class="gmail-s1"><font face="monospace, monospace">/home/work//installed/pgpool/bin/simple_conf/pool_passwd</font></span></p></div><div>The solution to this is to convert the relative path of the pgpool.conf to the absolute path at the startup and later use that absolute path for all other path calculations.</div><div><br></div><div>If you do not have any reservation, than I will start working on the fix.</div><div><br></div><div>Thanks</div><div>Best Regards</div><div>Muhammad Usama</div><div><br></div><div><br></div><div><br></div></div>