<div dir="ltr">This commit still needs to be back-ported to 3.4 and older branches.<div><br></div><div>Thanks</div><div>Best Regards</div><div>Muhammad Usama</div><div><br><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 21, 2017 at 6:37 PM, Muhammad Usama <span dir="ltr">&lt;<a href="mailto:m.usama@gmail.com" target="_blank">m.usama@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Fixing: [pgpool-hackers: 2390] Problems with the relative paths in daemon mode<br>
<br>
Pgpool-II does all the path related calculations based on CWD<br>
(current working directory) which only works as expected and intended<br>
until the CWD does not change.<br>
But in daemon mode the first thing Pgpool-II do after becoming the daemon<br>
process is, it changes it&#39;s CWD to system root (&quot;/&quot;) and after that all the<br>
relative paths becomes invalid.<br>
This means in daemon mode if the pgpool.conf file is specified as an argument<br>
using the relative path, Pgpool-II will not be able to find the pool_passwd<br>
or other required file whose location depends on the location of pgpool.conf<br>
file, and will eventually fail to start, or even worst may read/write<br>
some wrong file.<br>
<br>
The solution to this is to convert the relative path of the pgpool.conf and<br>
all file paths provided in the argument list to the Pgpool-II to the absolute<br>
paths at the startup and later use those absolute paths for all path related<br>
calculations.<br>
<br>
Apart from using the absolute paths for pgpool.conf, pcp.conf and pool_hba.conf<br>
files, The commit also modifies the behaviour of pid_file_name configuration<br>
parameter, when the relative path is used for this config in pgpool.conf,<br>
that relative path is considered with relative to the pgpool.conf path,<br>
instead of the current working directory.<br>
<br>
Branch<br>
------<br>
master<br>
<br>
Details<br>
-------<br>
<a href="https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=acfaa2fc07a7b0ae1b72b712023d44bade7d8f95" rel="noreferrer" target="_blank">https://git.postgresql.org/<wbr>gitweb?p=pgpool2.git;a=<wbr>commitdiff;h=<wbr>acfaa2fc07a7b0ae1b72b712023d44<wbr>bade7d8f95</a><br>
<br>
Modified Files<br>
--------------<br>
doc/src/sgml/misc-config.sgml              |   2 +<br>
src/include/utils/pool_path.h              |   2 +<br>
src/main/main.c                            | 107 +++++++++++++++++++++++++----<br>
src/main/pgpool_main.c                     |   6 +-<br>
src/pcp_con/pcp_worker.c                   |   2 +-<br>
src/redhat/pgpool.conf.sample.<wbr>patch        |   6 ++<br>
src/sample/pgpool.conf.sample              |   3 +<br>
src/sample/pgpool.conf.sample-<wbr>master-slave |   3 +<br>
src/sample/pgpool.conf.sample-<wbr>replication  |   3 +<br>
src/sample/pgpool.conf.sample-<wbr>stream       |   3 +<br>
src/utils/pool_path.c                      |  87 ++++++++++++++++++++++-<br>
11 files changed, 206 insertions(+), 18 deletions(-)<br>
<br>
<br>______________________________<wbr>_________________<br>
pgpool-committers mailing list<br>
<a href="mailto:pgpool-committers@pgpool.net">pgpool-committers@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-committers" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/<wbr>listinfo/pgpool-committers</a><br>
<br></blockquote></div><br></div>