[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.
This commit is contained in:
shuke authored and GitHub committed 2026-09-09 10:09:39 +08:00
1 parent 77cdd9cc9d
commit b3766d781b
4 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -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' |
+1 -1
View File
@@ -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' |
+1 -1
View File
@@ -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' |
+1 -1
View File
@@ -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' |