[ 
https://issues.apache.org/jira/browse/CASSANDRA-15567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17045740#comment-17045740
 ] 

David Capwell commented on CASSANDRA-15567:
-------------------------------------------

bq. I noticed on trunk that it was repeating the jar additions for some reason 
(which is probably why you thought I was putting it before),

If I run without your patch I get

{code}
for jar in "$CASSANDRA_HOME"/lib/*.jar; do
    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"
done
{code}

With your patch

{code}
for jar in "$CASSANDRA_HOME"/lib/*.jar; do
    CLASSPATH="$CLASSPATH:$jar"
done

CLASSPATH="$CLASSPATH:$EXTRA_CLASSPATH"

# JSR223 - collect all JSR223 engines' jars
for jsr223jar in "$CASSANDRA_HOME"/lib/jsr223/*/*.jar; do
    CLASSPATH="$CLASSPATH:$jsr223jar"
done
{code}

So the "$CASSANDRA_HOME"/*.jar; pattern is getting dropped (removed from the 
diff).  This was added in CASSANDRA-14710 and I don't know why HOME would have 
jars (I need to figure out how to build the packages... created CASSANDRA-15603 
to get Circle CI to at least build them) so I can't say if its ok to drop or 
not.


I am +1 if you add back the other jar loop.  

Here is the patch file which works for me

{code}
$ cat debian/patches/cassandra_in.sh_dirs.diff
--- 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 @@ fi
 
 # 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,10 @@ for jar in "$CASSANDRA_HOME"/lib/*.jar; do
     CLASSPATH="$CLASSPATH:$jar"
 done
 
+for jar in "$CASSANDRA_HOME"/*.jar; do
+    CLASSPATH="$CLASSPATH:$jar"
+done
+
 CLASSPATH="$CLASSPATH:$EXTRA_CLASSPATH"
 
 # JSR223 - collect all JSR223 engines' jars
{code}

> Allow EXTRA_CLASSPATH to work in tarball/source installations
> -------------------------------------------------------------
>
>                 Key: CASSANDRA-15567
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15567
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Local/Scripts
>            Reporter: Brandon Williams
>            Assignee: Brandon Williams
>            Priority: Normal
>             Fix For: 2.2.x, 3.0.x, 3.11.x, 4.0-beta
>
>
> Both the debian and redhat packaging modify cassandra.in.sh to support the 
> EXTRA_CLASSPATH variable.  It would be nice to just put this in 
> cassandra.in.sh proper so people without a package installation can use it as 
> well.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to