Previously, the directory for storing pgpool_status and lock files was specified by the logdir parameter.
However, since the name logdir was confusing, the parameter has been renamed to work_dir for clarity.
</listitem>
</varlistentry>
- <varlistentry id="guc-logdir" xreflabel="logdir">
- <term><varname>logdir</varname> (<type>string</type>)
+ <varlistentry id="guc-work-dir" xreflabel="work_dir">
+ <term><varname>work_dir</varname> (<type>string</type>)
<indexterm>
<!--
- <primary><varname>logdir</varname> configuration parameter</primary>
+ <primary><varname>work_dir</varname> configuration parameter</primary>
-->
- <primary><varname>logdir</varname> 設定パラメータ</primary>
+ <primary><varname>work_dir</varname> 設定パラメータ</primary>
</indexterm>
</term>
<listitem>
enables the testing facility of health checking. In this case the
health check process looks
into <filename>backend_down_request</filename>
- under <xref linkend="guc-logdir">. The file may contain multiple
+ under <xref linkend="guc-work-dir">. The file may contain multiple
lines, and each line corresponds to each backend. A line in the
file starts with backend id (must be a decimal number starting
with zero), then a TAB, and ends with "down". The backend is
repeating failovers.
-->
onにすると、ヘルスチェックのテスト機能が有効になります。
- この場合、ヘルスチェックプロセスは<xref linkend="guc-logdir">の下にある<filename>backend_down_request</filename>を参照します。
+ この場合、ヘルスチェックプロセスは<xref linkend="guc-work-dir">の下にある<filename>backend_down_request</filename>を参照します。
このファイルは、複数の行から構成され、各行は各々のバックエンドに対応します。
各行はバックエンドID(ゼロから始まる十進数でなければなりません)で始まり、続いてタブ、最後に"down"で終わります。
そのバックエンドはダウン状態と見なされ、<productname>Pgpool-II</productname>はフェイルオーバを開始します。
<!--
Doc: fix typo in logdir description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
-->
- Doc: <xref linkend="GUC-LOGDIR">に関するドキュメントのタイポを修正しました。(<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
+ Doc: <link linkend="GUC-WORK-DIR">logdir</link>に関するドキュメントのタイポを修正しました。(<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
</para>
</listitem>
<!--
Doc: fix typo in logdir description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
-->
- Doc: <xref linkend="GUC-LOGDIR">に関するドキュメントのタイポを修正しました。(<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
+ Doc: <link linkend="GUC-WORK-DIR">logdir</link>に関するドキュメントのタイポを修正しました。(<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
</para>
</listitem>
<!--
Doc: fix typo in logdir description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
-->
- Doc: <xref linkend="GUC-LOGDIR">に関するドキュメントのタイポを修正しました。(<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
+ Doc: <link linkend="GUC-WORK-DIR">logdir</link>に関するドキュメントのタイポを修正しました。(<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>)(Tatsuo Ishii)
</para>
</listitem>
</listitem>
</varlistentry>
- <varlistentry id="guc-logdir" xreflabel="logdir">
- <term><varname>logdir</varname> (<type>string</type>)
+ <varlistentry id="guc-work-dir" xreflabel="work_dir">
+ <term><varname>work_dir</varname> (<type>string</type>)
<indexterm>
- <primary><varname>logdir</varname> configuration parameter</primary>
+ <primary><varname>work_dir</varname> configuration parameter</primary>
</indexterm>
</term>
<listitem>
enables the testing facility of health checking. In this case the
health check process looks
into <filename>backend_down_request</filename>
- under <xref linkend="guc-logdir">. The file may contain multiple
+ under <xref linkend="guc-work-dir">. The file may contain multiple
lines, and each line corresponds to each backend. A line in the
file starts with backend id (must be a decimal number starting
with zero), then a TAB, and ends with "down". The backend is
2019-01-03 [79ef2b0]
-->
<para>
- Doc: fix typo in <xref linkend="GUC-LOGDIR"> description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>) (Tatsuo Ishii)
+ Doc: fix typo in <link linkend="GUC-WORK-DIR">logdir</link> description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>) (Tatsuo Ishii)
</para>
</listitem>
2019-01-03 [520649b]
-->
<para>
- Doc: fix typo in <xref linkend="GUC-LOGDIR"> description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>) (Tatsuo Ishii)
+ Doc: fix typo in <link linkend="GUC-WORK-DIR">logdir</link> description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>) (Tatsuo Ishii)
</para>
</listitem>
2019-01-03 [de632ca]
-->
<para>
- Doc: fix typo in <xref linkend="GUC-LOGDIR"> description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>) (Tatsuo Ishii)
+ Doc: fix typo in <link linkend="GUC-WORK-DIR">logdir</link> description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>) (Tatsuo Ishii)
</para>
</listitem>
/*variable custom assign functions */
static bool FailOverOnBackendErrorAssignMessage(ConfigContext scontext, bool newval, int elevel);
static bool DelegateIPAssignMessage(ConfigContext scontext, char *newval, int elevel);
+static bool LogDirAssignMessage(ConfigContext scontext, char *newval, int elevel);
static bool BackendPortAssignFunc(ConfigContext context, int newval, int index, int elevel);
static bool BackendHostAssignFunc(ConfigContext context, char *newval, int index, int elevel);
static bool BackendDataDirAssignFunc(ConfigContext context, char *newval, int index, int elevel);
{
{"logdir", CFGCXT_INIT, LOGGING_CONFIG,
- "PgPool status file logging directory.",
+ "Old config parameter for work_dir.",
+ CONFIG_VAR_TYPE_STRING, false, VAR_HIDDEN_IN_SHOW_ALL
+ },
+ NULL,
+ "",
+ LogDirAssignMessage, NULL, NULL, NULL
+ },
+
+ {
+ {"work_dir", CFGCXT_INIT, LOGGING_CONFIG,
+ "directory to create pgpool_status and lock files.",
CONFIG_VAR_TYPE_STRING, false, 0
},
- &g_pool_config.logdir,
+ &g_pool_config.work_dir,
DEFAULT_LOGDIR,
NULL, NULL, NULL, NULL
},
+
{
{"log_directory", CFGCXT_RELOAD, LOGGING_CONFIG,
"directory where log files are written.",
return true;
}
+/*
+ * Throws warning for if someone uses the removed logdir
+ * configuration parameter and set the value to work_dir
+ */
+static bool
+LogDirAssignMessage(ConfigContext scontext, char *newval, int elevel)
+{
+ if (scontext != CFGCXT_BOOT)
+ ereport(WARNING,
+ (errmsg("logdir is changed to work_dir"),
+ errdetail("if logdir is specified, the value will be set to work_dir")));
+ if (g_pool_config.work_dir)
+ pfree(g_pool_config.work_dir);
+ if (newval)
+ g_pool_config.work_dir = pstrdup(newval);
+ else
+ g_pool_config.work_dir = NULL;
+ return true;
+}
+
/*
* Check DB node spec. node spec should be either "primary", "standby" or
* numeric DB node id.
int authentication_timeout; /* maximum time in seconds to complete
* client authentication */
int max_pool; /* max # of connection pool per child */
- char *logdir; /* logging directory */
+ char *work_dir; /* directory to create pgpool_status and lock files */
char *log_destination_str; /* log destination: stderr and/or
* syslog */
int log_destination; /* log destination */
if (backend_down_request_file[0] == '\0')
{
snprintf(backend_down_request_file, sizeof(backend_down_request_file),
- "%s/%s", pool_config->logdir, BACKEND_DOWN_REQUEST_FILE);
+ "%s/%s", pool_config->work_dir, BACKEND_DOWN_REQUEST_FILE);
}
fd = fopen(backend_down_request_file, "r");
int lfd;
snprintf(query_cache_lock_path, sizeof(query_cache_lock_path),
- "%s/%s", pool_config->logdir, QUERY_CACHE_LOCK_FILE);
+ "%s/%s", pool_config->work_dir, QUERY_CACHE_LOCK_FILE);
lfd = open(query_cache_lock_path, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR);
if (lfd == -1)
{
pool_set_backend_status_changed_time(i);
}
- snprintf(fnamebuf, sizeof(fnamebuf), "%s/%s", pool_config->logdir, STATUS_FILE_NAME);
+ snprintf(fnamebuf, sizeof(fnamebuf), "%s/%s", pool_config->work_dir, STATUS_FILE_NAME);
fd = fopen(fnamebuf, "r");
if (!fd)
{
return 0;
}
- snprintf(fnamebuf, sizeof(fnamebuf), "%s/%s", pool_config->logdir, STATUS_FILE_NAME);
+ snprintf(fnamebuf, sizeof(fnamebuf), "%s/%s", pool_config->work_dir, STATUS_FILE_NAME);
fd = fopen(fnamebuf, "w");
if (!fd)
{
{
char *path;
- path = psprintf("%s/%s", pool_config->logdir, QUERY_CACHE_LOCK_FILE);
+ path = psprintf("%s/%s", pool_config->work_dir, QUERY_CACHE_LOCK_FILE);
memq_lock_fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR);
if (memq_lock_fd == -1)
{
# location of pgpool.conf file or
# as an absolute path
# (change requires restart)
-#logdir = '/tmp'
- # Directory of pgPool status file
+#work_dir = '/tmp'
+ # Directory for pgpool_status and lock files.
# (change requires restart)
StrNCpy(status[i].desc, "path to pid file", POOLCONFIG_MAXDESCLEN);
i++;
- StrNCpy(status[i].name, "logdir", POOLCONFIG_MAXNAMELEN);
- snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->logdir);
- StrNCpy(status[i].desc, "PgPool status file logging directory", POOLCONFIG_MAXDESCLEN);
+ StrNCpy(status[i].name, "work_dir", POOLCONFIG_MAXNAMELEN);
+ snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->work_dir);
+ StrNCpy(status[i].desc, "directory to create pgpool_status and lock files ", POOLCONFIG_MAXDESCLEN);
i++;
/* CONNECTION POOLING */
if (wd_debug_request_file[0] == '\0')
{
snprintf(wd_debug_request_file, sizeof(wd_debug_request_file),
- "%s/%s", pool_config->logdir, WATCHDOG_DEBUG_FILE);
+ "%s/%s", pool_config->work_dir, WATCHDOG_DEBUG_FILE);
}
fd = fopen(wd_debug_request_file, "r");