From 11a3f90e705c66e2d344b34fe2d31e6327819895 Mon Sep 17 00:00:00 2001 From: Alex Ott Date: Thu, 28 Dec 2017 09:52:55 +0100 Subject: [PATCH] fix for CASSANDRA-14142 cassandra-env scripts now check for existence of the 'logs' directory and create it if it doesn't exist. --- conf/cassandra-env.ps1 | 4 ++++ conf/cassandra-env.sh | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/conf/cassandra-env.ps1 b/conf/cassandra-env.ps1 index 72d632b88e4e..d5d92a36fa8b 100644 --- a/conf/cassandra-env.ps1 +++ b/conf/cassandra-env.ps1 @@ -276,6 +276,10 @@ Function SetCassandraEnvironment $env:CASSANDRA_PARAMS="-Dcassandra -Dlogback.configurationFile=logback.xml" $logdir = "$env:CASSANDRA_HOME\logs" + If(!(test-path $logdir)) + { + New-Item -ItemType Directory -Force -Path $logdir + } $storagedir = "$env:CASSANDRA_HOME\data" $env:CASSANDRA_PARAMS = $env:CASSANDRA_PARAMS + " -Dcassandra.logdir=""$logdir"" -Dcassandra.storagedir=""$storagedir""" diff --git a/conf/cassandra-env.sh b/conf/cassandra-env.sh index e7cf2cd3e3ef..bdc6d4cff903 100644 --- a/conf/cassandra-env.sh +++ b/conf/cassandra-env.sh @@ -122,7 +122,11 @@ case "$jvm" in esac #GC log path has to be defined here because it needs to access CASSANDRA_HOME -JVM_OPTS="$JVM_OPTS -Xloggc:${CASSANDRA_HOME}/logs/gc.log" +GCLOG_DIR="${CASSANDRA_HOME}/logs" +if [ ! -d "${GCLOG_DIR}" ] ; then + mkdir -p "${GCLOG_DIR}" +fi +JVM_OPTS="$JVM_OPTS -Xloggc:${GCLOG_DIR}/gc.log" # Here we create the arguments that will get passed to the jvm when # starting cassandra.