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

K8SPSMDB-1018: fix incorrect Bash quoting in ps-entry.sh script #1382

Merged
merged 4 commits into from
Jan 12, 2024
Merged
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
11 changes: 6 additions & 5 deletions build/ps-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ if [[ $originalArgOne == mongo* ]] && [ "$(id -u)" = '0' ]; then
chown --dereference mongodb "/proc/$$/fd/1" "/proc/$$/fd/2" || :
# ignore errors thanks to https://github.com/docker-library/mongo/issues/149

exec gosu mongodb:1001 "$BASH_SOURCE" "$@"
exec gosu mongodb:1001 "${BASH_SOURCE[0]}" "$@"
fi

# you should use numactl to start your mongod instances, including the config servers, mongos instances, and any clients.
# https://docs.mongodb.com/manual/administration/production-notes/#configuring-numa-on-linux
if [[ $originalArgOne == mongo* ]]; then
numa='numactl --interleave=all'
if $numa true &>/dev/null; then
set -- "$numa" "$@"
numa=(numactl --interleave=all)
if "${numa[@]}" true &>/dev/null; then
set -- "${numa[@]}" "$@"
fi
fi

Expand Down Expand Up @@ -88,7 +88,7 @@ _mongod_hack_get_arg_val() {
return 0
;;
"$checkArg"=*)
echo "${arg#$checkArg=}"
echo "${arg#"$checkArg"=}"
return 0
;;
esac
Expand Down Expand Up @@ -398,6 +398,7 @@ if [ "$originalArgOne" = 'mongod' ]; then
case "$f" in
*.sh)
echo "$0: running $f"
# shellcheck source=/dev/null
. "$f"
;;
*.js)
Expand Down
Loading