This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 769d13143021eaa15b06b01b48821d3fc2d78c05
Author: zy-kkk <zhongy...@gmail.com>
AuthorDate: Thu Jun 13 21:07:58 2024 +0800

    [fix](script) Set DYLD_LIBRARY_PATH for macOS in be nohup startup script 
(#36257)
    
    Following #36067, I found that some MacOS will block the passing of 
DYLD_LIBRARY_PATH in the case of nohup, so we need to actively set env during 
nohup
---
 bin/start_be.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/bin/start_be.sh b/bin/start_be.sh
index 21e28e30e1c..c2a4e5c8f9c 100755
--- a/bin/start_be.sh
+++ b/bin/start_be.sh
@@ -155,13 +155,13 @@ setup_java_env() {
     elif [[ -d "${JAVA_HOME}/jre" ]]; then
         export 
LD_LIBRARY_PATH="${JAVA_HOME}/jre/lib/${jvm_arch}/server:${JAVA_HOME}/jre/lib/${jvm_arch}:${LD_LIBRARY_PATH}"
         if [[ "$(uname -s)" == 'Darwin' ]]; then
-            export 
DYLD_LIBRARY_PATH="${JAVA_HOME}/jre/lib/${jvm_arch}/server:${JAVA_HOME}/jre/lib/${jvm_arch}:${DYLD_LIBRARY_PATH}"
+            export 
DYLD_LIBRARY_PATH="${JAVA_HOME}/jre/lib/server:${JAVA_HOME}/jre/lib:${DYLD_LIBRARY_PATH}"
         fi
         # JAVA_HOME is jre
     else
         export 
LD_LIBRARY_PATH="${JAVA_HOME}/lib/${jvm_arch}/server:${JAVA_HOME}/lib/${jvm_arch}:${LD_LIBRARY_PATH}"
         if [[ "$(uname -s)" == 'Darwin' ]]; then
-            export 
DYLD_LIBRARY_PATH="${JAVA_HOME}/lib/${jvm_arch}/server:${JAVA_HOME}/lib/${jvm_arch}:${DYLD_LIBRARY_PATH}"
+            export 
DYLD_LIBRARY_PATH="${JAVA_HOME}/lib/server:${JAVA_HOME}/lib:${DYLD_LIBRARY_PATH}"
         fi
     fi
 }
@@ -416,7 +416,11 @@ else
 fi
 
 if [[ "${RUN_DAEMON}" -eq 1 ]]; then
-    nohup ${LIMIT:+${LIMIT}} "${DORIS_HOME}/lib/doris_be" "$@" 
>>"${LOG_DIR}/be.out" 2>&1 </dev/null &
+    if [[ "$(uname -s)" == 'Darwin' ]]; then
+        nohup env DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}" ${LIMIT:+${LIMIT}} 
"${DORIS_HOME}/lib/doris_be" "$@" >>"${LOG_DIR}/be.out" 2>&1 </dev/null &
+    else
+        nohup ${LIMIT:+${LIMIT}} "${DORIS_HOME}/lib/doris_be" "$@" 
>>"${LOG_DIR}/be.out" 2>&1 </dev/null &
+    fi
 elif [[ "${RUN_CONSOLE}" -eq 1 ]]; then
     export DORIS_LOG_TO_STDERR=1
     ${LIMIT:+${LIMIT}} "${DORIS_HOME}/lib/doris_be" "$@" 2>&1 </dev/null


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to