From f9c84d6287ddd9aa4b43910753c283268f70b661 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Wed, 6 Mar 2024 15:12:39 +0800 Subject: [PATCH] Optimize script logs --- scripts/install/openim-api.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install/openim-api.sh b/scripts/install/openim-api.sh index 8a7b8d1f1..cd3d5eb08 100755 --- a/scripts/install/openim-api.sh +++ b/scripts/install/openim-api.sh @@ -88,8 +88,8 @@ function openim::api::start_service() { echo "Starting service with command: $cmd" - nohup $cmd >> "${LOG_FILE}" 2> >(tee -a "${STDERR_LOG_FILE}" "$TMP_LOG_FILE" >&2) & - + #nohup $cmd >> "${LOG_FILE}" 2> >(tee -a "${STDERR_LOG_FILE}" "$TMP_LOG_FILE" >&2) & + nohup ${cmd} >> "${LOG_FILE}" 2> >(tee -a "$TMP_LOG_FILE" | while read line; do echo -e "\e[31m${line}\e[0m"; done >&2) >/dev/null & if [ $? -ne 0 ]; then openim::log::error_exit "Failed to start ${binary_name} on port ${service_port}." return 1