From 08e655d8baef3e1b2d7101c291e6e9626ecb65c7 Mon Sep 17 00:00:00 2001 From: Yuval Lifshitz Date: Mon, 23 Oct 2023 13:46:06 +0000 Subject: [PATCH] rgw/lua: print luarocks config during reload Signed-off-by: Yuval Lifshitz --- src/rgw/rgw_lua.cc | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_lua.cc b/src/rgw/rgw_lua.cc index 6a5780a3eb1..5b518d2e27c 100644 --- a/src/rgw/rgw_lua.cc +++ b/src/rgw/rgw_lua.cc @@ -213,11 +213,33 @@ int install_packages(const DoutPrefixProvider *dpp, rgw::sal::Driver* driver, return rc; } install_dir.assign(tmp_luarocks_path); + + { + bp::ipstream is; + const auto cmd = p.string() + " config"; + bp::child c(cmd, bp::std_in.close(), (bp::std_err & bp::std_out) > is); + + std::string lines = std::string("Lua CMD: ") + cmd; + std::string line; + + do { + if (!line.empty()) { + lines.append("\n\t"); + lines.append(line); + } + } while (c.running() && std::getline(is, line)); + + c.wait(); + line = "exit code: " + std::to_string(c.exit_code()); + lines.append("\n\t"); + lines.append(line); + ldpp_dout(dpp, 20) << lines << dendl; + } // the lua rocks install dir will be created by luarocks the first time it is called for (const auto& package : packages) { bp::ipstream is; - const auto cmd = p.string() + " install --lua-version " + CEPH_LUA_VERSION + " --tree " + install_dir + " --deps-mode one " + package; + const auto cmd = p.string() + " install --no-doc --no-manifest --check-lua-versions --lua-version " + CEPH_LUA_VERSION + " --tree " + install_dir + " --deps-mode one " + package; bp::child c(cmd, bp::std_in.close(), (bp::std_err & bp::std_out) > is); // once package reload is supported, code should yield when reading output -- 2.47.3