Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH] lua: fix for option changed by tarantoolctl
@ 2018-07-20 16:53 Konstantin Belyavskiy
  2018-07-23 13:23 ` [tarantool-patches] " Georgy Kirichenko
  0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Belyavskiy @ 2018-07-20 16:53 UTC (permalink / raw)
  To: tarantool-patches

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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-23 13:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-20 16:53 [tarantool-patches] [PATCH] lua: fix for option changed by tarantoolctl Konstantin Belyavskiy
2018-07-23 13:23 ` [tarantool-patches] " Georgy Kirichenko

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