Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix_docker,iotdb-system.properties contains all configuration,stop-standalone.sh will be called anyway #14781

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions docker/src/main/DockerCompose/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,8 @@ function on_stop(){
if [[ "$start_what" != "confignode" ]]; then
echo "###### manually flush ######";
start-cli.sh -e "flush;" || true
stop-datanode.sh
echo "##### done ######";
else
stop-confignode.sh;
fi
stop-standalone.sh
}

trap 'on_stop' SIGTERM SIGKILL SIGQUIT
Expand Down
33 changes: 17 additions & 16 deletions docker/src/main/DockerCompose/replace-conf-from-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,37 @@
conf_path=${IOTDB_HOME}/conf
target_files="iotdb-system.properties"

function process_single() {
local key_value="$1"
local filename=$2
local key=$(echo $key_value | cut -d = -f1)
local line=$(grep -ni "${key}=" ${filename})
#echo "line=$line"
if [[ -n "${line}" ]]; then
function process_single(){
local key_value="$1"
local filename=$2
local key=$(echo $key_value|cut -d = -f1)
local line=$(grep -ni "${key}=" ${filename})
#echo "line=$line"
if [[ -n "${line}" ]]; then
echo "update $key $filename"
local line_no=$(echo $line | cut -d : -f1)
local content=$(echo $line | cut -d : -f2)
local line_no=$(echo $line|cut -d : -f1)
local content=$(echo $line|cut -d : -f2)
if [[ "${content:0:1}" != "#" ]]; then
sed -i "${line_no}d" ${filename}
fi
sed -i "${line_no} i${key_value}" ${filename}
else
echo "append $key to $filename"

echo "${key_value}" >>"${filename}"
fi
echo "append $key $filename"
line_no=$(wc -l $filename)
sed -i "${line_no} a${key_value}" ${filename}
fi
}

function replace_configs() {
function replace_configs(){
for v in $(env); do
if [[ "${v}" =~ "=" && "${v}" =~ "_" && ! "${v}" =~ "JAVA_" ]]; then
# echo "###### $v ####"
# echo "###### $v ####"
for f in ${target_files}; do
process_single $v ${conf_path}/$f
process_single $v ${conf_path}/$f
done
fi
done
}

replace_configs

Loading