mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 02:42:19 +08:00
Optimizing Docker Log Output Detection
This commit is contained in:
parent
13d4164c18
commit
6fed7607d5
@ -26,8 +26,10 @@
|
|||||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||||
source "${OPENIM_ROOT}/scripts/install/common.sh"
|
source "${OPENIM_ROOT}/scripts/install/common.sh"
|
||||||
|
|
||||||
if grep -q docker /proc/1/cgroup; then
|
if openim::util::is_running_in_container; then
|
||||||
exec > ${DOCKER_LOG_FILE} 2>&1
|
exec > ${DOCKER_LOG_FILE} 2>&1
|
||||||
|
else
|
||||||
|
echo "host!!!!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2866,6 +2866,15 @@ function openim::util::gen_os_arch() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function openim::util::is_running_in_container() {
|
||||||
|
if grep -qE 'docker|kubepods' /proc/1/cgroup || [ -f /.dockerenv ]; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function openim::util::check_process_names_for_stop() {
|
function openim::util::check_process_names_for_stop() {
|
||||||
local all_stopped=true
|
local all_stopped=true
|
||||||
for service in "${OPENIM_ALL_SERVICE_LIBRARIES[@]}"; do
|
for service in "${OPENIM_ALL_SERVICE_LIBRARIES[@]}"; do
|
||||||
|
|||||||
@ -62,8 +62,10 @@ function execute_start_scripts() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if grep -q docker /proc/1/cgroup; then
|
if openim::util::is_running_in_container; then
|
||||||
exec > ${DOCKER_LOG_FILE} 2>&1
|
exec > ${DOCKER_LOG_FILE} 2>&1
|
||||||
|
else
|
||||||
|
echo "host!!!!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user