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() {