Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Belyavskiy <k.belyavskiy@tarantool.org>
To: tarantool-patches@freelists.org
Subject: [tarantool-patches] [PATCH] lua: fix for option changed by tarantoolctl
Date: Fri, 20 Jul 2018 19:53:59 +0300	[thread overview]
Message-ID: <20180720165359.8718-1-k.belyavskiy@tarantool.org> (raw)

During startup tarantoolctl ignores 'pid_file' option and
set it to default value.
This cause a fault if user tries to execute config with option set.

Closes #3214
---
ticket: https://github.com/tarantool/tarantool/issues/3214
branch: https://github.com/tarantool/tarantool/tree/kbelyavs/gh-3214-tarantoolctl-pidfile-fix
 extra/dist/tarantoolctl.in | 5 ++++-
 src/box/lua/load_cfg.lua   | 8 +++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/extra/dist/tarantoolctl.in b/extra/dist/tarantoolctl.in
index 507ebe8bf..0c806d086 100755
--- a/extra/dist/tarantoolctl.in
+++ b/extra/dist/tarantoolctl.in
@@ -443,7 +443,10 @@ local function wrapper_cfg(cfg)
         end
     end
     -- force these startup options
-    cfg.pid_file = default_cfg.pid_file
+    if cfg.pid_file ~= default_cfg.pid_file then
+        log.warn("then using with tarantoolctl option 'pid_file' is ignored")
+        cfg.pid_file = default_cfg.pid_file
+    end
     if os.getenv('USER') ~= default_cfg.username then
         cfg.username = default_cfg.username
     else
diff --git a/src/box/lua/load_cfg.lua b/src/box/lua/load_cfg.lua
index 4910ec4b6..89ebbd368 100644
--- a/src/box/lua/load_cfg.lua
+++ b/src/box/lua/load_cfg.lua
@@ -328,7 +328,13 @@ local function reload_cfg(oldcfg, cfg)
     -- iterate over original table because prepare_cfg() may store NILs
     for key, val in pairs(cfg) do
         if dynamic_cfg[key] == nil and oldcfg[key] ~= val then
-            box.error(box.error.RELOAD_CFG, key);
+            -- then started with tarantoolctl this option is set to
+            -- default value, see #3214.
+            if key == "pid_file" then
+                log.info("Can't set option '%s' dynamically", key)
+            else
+                box.error(box.error.RELOAD_CFG, key);
+            end
         end
     end
     for key in pairs(cfg) do
-- 
2.14.3 (Apple Git-98)

             reply	other threads:[~2018-07-20 16:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20 16:53 Konstantin Belyavskiy [this message]
2018-07-23 13:23 ` [tarantool-patches] " Georgy Kirichenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180720165359.8718-1-k.belyavskiy@tarantool.org \
    --to=k.belyavskiy@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH] lua: fix for option changed by tarantoolctl' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox