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

hello-stephen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new b3766d781b5 [fix](bin) Read final config lines without trailing 
newlines (#67663)
b3766d781b5 is described below

commit b3766d781b529f89ec2dadcf53ecf712aec0ae7b
Author: shuke <[email protected]>
AuthorDate: Wed Sep 9 10:09:39 2026 +0800

    [fix](bin) Read final config lines without trailing newlines (#67663)
    
    Problem Summary:
    
    FE/BE startup and shutdown scripts silently skip the final environment
    assignment in `fe.conf` or `be.conf` when the file has no trailing
    newline. For example, a final `PID_DIR=/custom/pid` is ignored, so the
    script uses the default or an earlier PID directory.
    
    Bash `read` sets `line` but returns failure when EOF terminates a
    partial line. Keep each of the four configuration loops running when
    that final line is nonempty so the existing parser exports it.
    
    ### Release note
    
    Fix FE/BE startup and shutdown scripts ignoring the last configuration
    assignment when the file has no trailing newline.
---
 bin/start_be.sh | 2 +-
 bin/start_fe.sh | 2 +-
 bin/stop_be.sh  | 2 +-
 bin/stop_fe.sh  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/start_be.sh b/bin/start_be.sh
index 2727b1b1ad2..49e4009399b 100755
--- a/bin/start_be.sh
+++ b/bin/start_be.sh
@@ -95,7 +95,7 @@ PID_DIR="$(
 export PID_DIR
 
 # read from be.conf
-while read -r line; do
+while read -r line || [[ -n "${line}" ]]; do
     envline="$(echo "${line}" |
         sed 's/[[:blank:]]*=[[:blank:]]*/=/g' |
         sed 's/^[[:blank:]]*//g' |
diff --git a/bin/start_fe.sh b/bin/start_fe.sh
index ada7b887abc..feb60198274 100755
--- a/bin/start_fe.sh
+++ b/bin/start_fe.sh
@@ -127,7 +127,7 @@ PID_DIR="$(
 )"
 export PID_DIR
 
-while read -r line; do
+while read -r line || [[ -n "${line}" ]]; do
     envline="$(echo "${line}" |
         sed 's/[[:blank:]]*=[[:blank:]]*/=/g' |
         sed 's/^[[:blank:]]*//g' |
diff --git a/bin/stop_be.sh b/bin/stop_be.sh
index 974df77a1d8..121c6874fa9 100755
--- a/bin/stop_be.sh
+++ b/bin/stop_be.sh
@@ -32,7 +32,7 @@ PID_DIR="$(
 )"
 export PID_DIR
 
-while read -r line; do
+while read -r line || [[ -n "${line}" ]]; do
     envline="$(echo "${line}" |
         sed 's/[[:blank:]]*=[[:blank:]]*/=/g' |
         sed 's/^[[:blank:]]*//g' |
diff --git a/bin/stop_fe.sh b/bin/stop_fe.sh
index 5a8486fe26f..de0c4908318 100755
--- a/bin/stop_fe.sh
+++ b/bin/stop_fe.sh
@@ -32,7 +32,7 @@ PID_DIR="$(
 )"
 export PID_DIR
 
-while read -r line; do
+while read -r line || [[ -n "${line}" ]]; do
     envline="$(echo "${line}" |
         sed 's/[[:blank:]]*=[[:blank:]]*/=/g' |
         sed 's/^[[:blank:]]*//g' |


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to