From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 955CF262B1 for ; Fri, 20 Jul 2018 12:54:01 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id A583sFYJ62Xe for ; Fri, 20 Jul 2018 12:54:01 -0400 (EDT) Received: from smtp5.mail.ru (smtp5.mail.ru [94.100.179.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 5503922939 for ; Fri, 20 Jul 2018 12:54:01 -0400 (EDT) Received: from [185.6.245.156] (port=54699 helo=localhost.localdomain) by smtp5.mail.ru with esmtpa (envelope-from ) id 1fgYfH-0004EW-Nk for tarantool-patches@freelists.org; Fri, 20 Jul 2018 19:53:59 +0300 From: Konstantin Belyavskiy Subject: [tarantool-patches] [PATCH] lua: fix for option changed by tarantoolctl Date: Fri, 20 Jul 2018 19:53:59 +0300 Message-Id: <20180720165359.8718-1-k.belyavskiy@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org 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)