This is an automated email from the ASF dual-hosted git repository. mshuler pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/trunk by this push: new 3a87604 Use quilt to patch cassandra.in.sh in Debian packaging 3a87604 is described below commit 3a87604e4c83939f05d1a51e577e69d45dc7345d Author: Michael Shuler <mshu...@apache.org> AuthorDate: Thu May 9 10:55:09 2019 -0500 Use quilt to patch cassandra.in.sh in Debian packaging Patch by Michael Shuler; Reviewed by Jan Karlsson for CASSANDRA-14710 --- CHANGES.txt | 1 + debian/cassandra.in.sh | 110 ------------------------------- debian/cassandra.install | 2 +- debian/patches/cassandra_in.sh_dirs.diff | 50 ++++++++++++++ debian/patches/series | 1 + 5 files changed, 53 insertions(+), 111 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index e4849d3..740bc21 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 4.0 + * Use quilt to patch cassandra.in.sh in Debian packaging (CASSANDRA-14710) * Take sstable references before calculating approximate key count (CASSANDRA-14647) * Restore snapshotting of system keyspaces on version change (CASSANDRA-14412) * Fix AbstractBTreePartition locking in java 11 (CASSANDRA-14607) diff --git a/debian/cassandra.in.sh b/debian/cassandra.in.sh deleted file mode 100644 index 552731d..0000000 --- a/debian/cassandra.in.sh +++ /dev/null @@ -1,110 +0,0 @@ - -# The directory where Cassandra's configs live (required) -CASSANDRA_CONF=/etc/cassandra - -CASSANDRA_HOME=/usr/share/cassandra - -# the default location for commitlogs, sstables, and saved caches -# if not set in cassandra.yaml -cassandra_storagedir=/var/lib/cassandra - -# The java classpath (required) -if [ -n "$CLASSPATH" ]; then - CLASSPATH=$CLASSPATH:$CASSANDRA_CONF -else - CLASSPATH=$CASSANDRA_CONF -fi - -for jar in /usr/share/cassandra/lib/*.jar; do - CLASSPATH=$CLASSPATH:$jar -done - -for jar in /usr/share/cassandra/*.jar; do - CLASSPATH=$CLASSPATH:$jar -done - -CLASSPATH="$CLASSPATH:$EXTRA_CLASSPATH" - - -# set JVM javaagent opts to avoid warnings/errors -JAVA_AGENT="$JAVA_AGENT -javaagent:$CASSANDRA_HOME/lib/jamm-0.3.2.jar" - - -# -# Java executable and per-Java version JVM settings -# - -# Use JAVA_HOME if set, otherwise look for java in PATH -if [ -n "$JAVA_HOME" ]; then - # Why we can't have nice things: Solaris combines x86 and x86_64 - # installations in the same tree, using an unconventional path for the - # 64bit JVM. Since we prefer 64bit, search the alternate path first, - # (see https://issues.apache.org/jira/browse/CASSANDRA-4638). - for java in "$JAVA_HOME"/bin/amd64/java "$JAVA_HOME"/bin/java; do - if [ -x "$java" ]; then - JAVA="$java" - break - fi - done -else - JAVA=java -fi - -if [ -z $JAVA ] ; then - echo Unable to find java executable. Check JAVA_HOME and PATH environment variables. >&2 - exit 1; -fi - -# Determine the sort of JVM we'll be running on. -java_ver_output=`"${JAVA:-java}" -version 2>&1` -jvmver=`echo "$java_ver_output" | grep '[openjdk|java] version' | awk -F'"' 'NR==1 {print $2}' | cut -d\- -f1` -JVM_VERSION=${jvmver%_*} - -JAVA_VERSION=11 -if [ "$JVM_VERSION" = "1.8.0" ] ; then - JVM_PATCH_VERSION=${jvmver#*_} - if [ "$JVM_VERSION" \< "1.8" ] || [ "$JVM_VERSION" \> "1.8.2" ] ; then - echo "Cassandra 4.0 requires either Java 8 (update 151 or newer) or Java 11 (or newer). Java $JVM_VERSION is not supported." - exit 1; - fi - if [ "$JVM_PATCH_VERSION" -lt 151 ] ; then - echo "Cassandra 4.0 requires either Java 8 (update 151 or newer) or Java 11 (or newer). Java 8 update $JVM_PATCH_VERSION is not supported." - exit 1; - fi - JAVA_VERSION=8 -elif [ "$JVM_VERSION" \< "11" ] ; then - echo "Cassandra 4.0 requires either Java 8 (update 151 or newer) or Java 11 (or newer)." - exit 1; -fi - -jvm=`echo "$java_ver_output" | grep -A 1 '[openjdk|java] version' | awk 'NR==2 {print $1}'` -case "$jvm" in - OpenJDK) - JVM_VENDOR=OpenJDK - # this will be "64-Bit" or "32-Bit" - JVM_ARCH=`echo "$java_ver_output" | awk 'NR==3 {print $2}'` - ;; - "Java(TM)") - JVM_VENDOR=Oracle - # this will be "64-Bit" or "32-Bit" - JVM_ARCH=`echo "$java_ver_output" | awk 'NR==3 {print $3}'` - ;; - *) - # Help fill in other JVM values - JVM_VENDOR=other - JVM_ARCH=unknown - ;; -esac - -# Read user-defined JVM options from jvm-server.options file -JVM_OPTS_FILE=$CASSANDRA_CONF/jvm${jvmoptions_variant:--clients}.options -if [ $JAVA_VERSION -ge 11 ] ; then - JVM_DEP_OPTS_FILE=$CASSANDRA_CONF/jvm11${jvmoptions_variant:--clients}.options -else - JVM_DEP_OPTS_FILE=$CASSANDRA_CONF/jvm8${jvmoptions_variant:--clients}.options -fi - -for opt in `grep "^-" $JVM_OPTS_FILE` `grep "^-" $JVM_DEP_OPTS_FILE` -do - JVM_OPTS="$JVM_OPTS $opt" -done diff --git a/debian/cassandra.install b/debian/cassandra.install index 9043f56..da800a4 100644 --- a/debian/cassandra.install +++ b/debian/cassandra.install @@ -8,9 +8,9 @@ conf/logback-tools.xml etc/cassandra conf/jvm*.options etc/cassandra conf/hotspot_compiler etc/cassandra conf/triggers/* etc/cassandra/triggers -debian/cassandra.in.sh usr/share/cassandra debian/cassandra.conf etc/security/limits.d debian/cassandra-sysctl.conf etc/sysctl.d +bin/cassandra.in.sh usr/share/cassandra bin/cassandra usr/sbin bin/nodetool usr/bin bin/sstableutil usr/bin diff --git a/debian/patches/cassandra_in.sh_dirs.diff b/debian/patches/cassandra_in.sh_dirs.diff new file mode 100644 index 0000000..2d91442 --- /dev/null +++ b/debian/patches/cassandra_in.sh_dirs.diff @@ -0,0 +1,50 @@ +--- a/bin/cassandra.in.sh ++++ b/bin/cassandra.in.sh +@@ -14,17 +14,17 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-if [ "x$CASSANDRA_HOME" = "x" ]; then +- CASSANDRA_HOME="`dirname "$0"`/.." +-fi ++CASSANDRA_HOME=/usr/share/cassandra + + # The directory where Cassandra's configs live (required) +-if [ "x$CASSANDRA_CONF" = "x" ]; then +- CASSANDRA_CONF="$CASSANDRA_HOME/conf" +-fi ++CASSANDRA_CONF=/etc/cassandra + + # The java classpath (required) +-CLASSPATH="$CASSANDRA_CONF" ++if [ -n "$CLASSPATH" ]; then ++ CLASSPATH=$CLASSPATH:$CASSANDRA_CONF ++else ++ CLASSPATH="$CASSANDRA_CONF" ++fi + + # This can be the path to a jar file, or a directory containing the + # compiled classes. NOTE: This isn't needed by the startup script, +@@ -38,7 +38,7 @@ + + # the default location for commitlogs, sstables, and saved caches + # if not set in cassandra.yaml +-cassandra_storagedir="$CASSANDRA_HOME/data" ++cassandra_storagedir=/var/lib/cassandra + + # JAVA_HOME can optionally be set here + #JAVA_HOME=/usr/local/jdk6 +@@ -47,6 +47,13 @@ + CLASSPATH="$CLASSPATH:$jar" + done + ++for jar in "$CASSANDRA_HOME"/*.jar; do ++ CLASSPATH="$CLASSPATH:$jar" ++done ++ ++# Include EXTRA_CLASSPATH from /etc/default/cassandra ++CLASSPATH="$CLASSPATH:$EXTRA_CLASSPATH" ++ + # JSR223 - collect all JSR223 engines' jars + for jsr223jar in "$CASSANDRA_HOME"/lib/jsr223/*/*.jar; do + CLASSPATH="$CLASSPATH:$jsr223jar" diff --git a/debian/patches/series b/debian/patches/series index 3c16596..5e52a9c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ cassandra_logdir_fix.diff cassandra_yaml_dirs.diff +cassandra_in.sh_dirs.diff --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org