From 266237861baeb85fcda800afe4ed7157d7a79bbb Mon Sep 17 00:00:00 2001 From: Xinwei Xiong <3293172751@qq.com> Date: Fri, 12 Jan 2024 20:21:36 +0800 Subject: [PATCH] Update openim-tools.sh --- scripts/install/openim-tools.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/install/openim-tools.sh b/scripts/install/openim-tools.sh index a369a8158..385df64f5 100755 --- a/scripts/install/openim-tools.sh +++ b/scripts/install/openim-tools.sh @@ -103,8 +103,13 @@ function openim::tools::start_service() { printf "Specifying prometheus port: %s\n" "${prometheus_port}" cmd="${cmd} --prometheus_port ${prometheus_port}" fi - openim::log::info "Starting ${binary_name}..." - ${cmd} >> "${LOG_FILE}" 2>&1 & + openim::log::status "Starting ${binary_name}..." + # Later, after discarding Docker, the Docker keyword is unreliable, and Kubepods is used + if grep -qE 'docker|kubepods' /proc/1/cgroup || [ -f /.dockerenv ]; then + ${cmd} >> "${LOG_FILE}" 2>&1 + else + ${cmd} | tee -a "${LOG_FILE}" + fi } function openim::tools::start() {