Remove bashisms for mx4j tool in cassandra-env.sh

/bin/sh (our shebang in bin/cassandra) does not recognize the
`if` construct which is available in /bin/bash only hence if
MX4J_ADDRESS or MX4J_PORT was not commented out, the script would
fail to execute it.

patch by Stefan Miklosovic; reviewed by Brandon Williams for CASSANDRA-19416
This commit is contained in:
Stefan Miklosovic 2024-02-20 19:43:58 +01:00
parent 505f5af645
commit 98d0e181d5
No known key found for this signature in database
GPG Key ID: 32F35CB2F546D93E
2 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,5 @@
4.0.13
* Remove bashisms for mx4j tool in cassandra-env.sh (CASSANDRA-19416)
* Add new concurrent_merkle_tree_requests config property to prevent OOM during multi-range and/or multi-table repairs (CASSANDRA-19336)
Merged from 3.11:
Merged from 3.0:

View File

@ -287,7 +287,7 @@ JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.password.file=/etc/cassandra/
JVM_OPTS="$JVM_OPTS -Djava.library.path=$CASSANDRA_HOME/lib/sigar-bin"
if [ "x$MX4J_ADDRESS" != "x" ]; then
if [[ "$MX4J_ADDRESS" == \-Dmx4jaddress* ]]; then
if [ "$(echo "$MX4J_ADDRESS" | grep -c "\-Dmx4jaddress")" = "1" ]; then
# Backward compatible with the older style #13578
JVM_OPTS="$JVM_OPTS $MX4J_ADDRESS"
else
@ -295,7 +295,7 @@ if [ "x$MX4J_ADDRESS" != "x" ]; then
fi
fi
if [ "x$MX4J_PORT" != "x" ]; then
if [[ "$MX4J_PORT" == \-Dmx4jport* ]]; then
if [ "$(echo "$MX4J_PORT" | grep -c "\-Dmx4jport")" = "1" ]; then
# Backward compatible with the older style #13578
JVM_OPTS="$JVM_OPTS $MX4J_PORT"
else