Re: fixing pg_ctl with relative paths

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Hari Babu <haribabu(dot)kommi(at)huawei(dot)com>
Cc: Josh Kupershmidt <schmiddy(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: fixing pg_ctl with relative paths
Date: 2013-06-26 16:22:52
Message-ID: CAHGQGwFT+qP+Dkk00SBvOEvtw0RBy=tF0jLmFEZtGFzM2RVYOw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 26, 2013 at 2:36 PM, Hari Babu <haribabu(dot)kommi(at)huawei(dot)com> wrote:
> On June 26, 2013 5:02 AM Josh Kupershmidt wrote:
>>Thanks for the feedback. Attached is a rebased version of the patch with
> the two small issues noted fixed.

The following description in the document of pg_ctl needs to be modified?

restart might fail if relative paths specified were specified on
the command-line during server start.

+#define DATADIR_SPEC "\"-D\" \""
+
+ datadir = strstr(post_opts, DATADIR_SPEC);

Though this is a corner case, the patch doesn't seem to handle properly the case
where "-D" appears as other option value, e.g., -k option value, in
postmaster.opts
file.

Just idea to work around that problem is to just append the specified -D option
and value to post_opts. IOW, -D option and value appear twice in post_opts.
In this case, posteriorly-located ones are used in the end. Thought?

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitriy Igrishin 2013-06-26 16:35:49 Re: [HACKERS] Frontend/backend protocol improvements proposal (request).
Previous Message Tom Lane 2013-06-26 16:17:18 Re: Add more regression tests for dbcommands