From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp60.i.mail.ru (smtp60.i.mail.ru [217.69.128.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id C2AC5431780 for ; Sun, 16 Aug 2020 23:41:40 +0300 (MSK) From: "Alexander V. Tikhonov" Date: Sun, 16 Aug 2020 23:41:38 +0300 Message-Id: Subject: [Tarantool-patches] [PATCH v1] tarantoolctl fails to stop server List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kirill Yukhin , Alexander Turenko Cc: tarantool-patches@dev.tarantool.org When server process couldn't be stopped with SIGTERM as described in [1], then tarantoolctl didn't check its status and returned success exit code. To fix it, check of the process after SIGTERM send should be added and if the process was still alive than it should be killed with SIGKILL. Also some time delay added before the process status check to be sure that it completely gone. Closed #5245 [1] - https://github.com/tarantool/tarantool/issues/5244 --- Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-5245-tarantoolctl-kills Issue: https://github.com/tarantool/tarantool/issues/5244 extra/dist/tarantoolctl.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/extra/dist/tarantoolctl.in b/extra/dist/tarantoolctl.in index 90caf58ad..7bf3808f8 100755 --- a/extra/dist/tarantoolctl.in +++ b/extra/dist/tarantoolctl.in @@ -600,6 +600,15 @@ local function stop() fio.unlink(pid_file) return 1 end + fiber.sleep(1) + if fio.stat(pid_file) ~= nil then + log.info("Kill not terminated process %d", pid) + if ffi.C.kill(pid, 9) < 0 then + log.error("Can't kill process %d: %s", pid, errno.strerror()) + fio.unlink(pid_file) + return 1 + end + end return 0 end -- 2.17.1