[pgpool-committers: 4099] Re: pgpool: Fixing: [pgpool-hackers: 2390] Problems with the relative paths

Muhammad Usama m.usama at gmail.com
Wed Jun 21 22:48:42 JST 2017


This commit still needs to be back-ported to 3.4 and older branches.

Thanks
Best Regards
Muhammad Usama



On Wed, Jun 21, 2017 at 6:37 PM, Muhammad Usama <m.usama at gmail.com> wrote:

> Fixing: [pgpool-hackers: 2390] Problems with the relative paths in daemon
> mode
>
> Pgpool-II does all the path related calculations based on CWD
> (current working directory) which only works as expected and intended
> until the CWD does not change.
> But in daemon mode the first thing Pgpool-II do after becoming the daemon
> process is, it changes it's CWD to system root ("/") and after that all the
> relative paths becomes invalid.
> This means in daemon mode if the pgpool.conf file is specified as an
> argument
> using the relative path, Pgpool-II will not be able to find the pool_passwd
> or other required file whose location depends on the location of
> pgpool.conf
> file, and will eventually fail to start, or even worst may read/write
> some wrong file.
>
> The solution to this is to convert the relative path of the pgpool.conf and
> all file paths provided in the argument list to the Pgpool-II to the
> absolute
> paths at the startup and later use those absolute paths for all path
> related
> calculations.
>
> Apart from using the absolute paths for pgpool.conf, pcp.conf and
> pool_hba.conf
> files, The commit also modifies the behaviour of pid_file_name
> configuration
> parameter, when the relative path is used for this config in pgpool.conf,
> that relative path is considered with relative to the pgpool.conf path,
> instead of the current working directory.
>
> Branch
> ------
> master
>
> Details
> -------
> https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=
> acfaa2fc07a7b0ae1b72b712023d44bade7d8f95
>
> Modified Files
> --------------
> doc/src/sgml/misc-config.sgml              |   2 +
> src/include/utils/pool_path.h              |   2 +
> src/main/main.c                            | 107
> +++++++++++++++++++++++++----
> src/main/pgpool_main.c                     |   6 +-
> src/pcp_con/pcp_worker.c                   |   2 +-
> src/redhat/pgpool.conf.sample.patch        |   6 ++
> src/sample/pgpool.conf.sample              |   3 +
> src/sample/pgpool.conf.sample-master-slave |   3 +
> src/sample/pgpool.conf.sample-replication  |   3 +
> src/sample/pgpool.conf.sample-stream       |   3 +
> src/utils/pool_path.c                      |  87 ++++++++++++++++++++++-
> 11 files changed, 206 insertions(+), 18 deletions(-)
>
>
> _______________________________________________
> pgpool-committers mailing list
> pgpool-committers at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-committers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-committers/attachments/20170621/19964cc0/attachment.html>


More information about the pgpool-committers mailing list