eliminate redundant classpath creation

Patch by eevans; reviewed by Anton Winter for CASSANDRA-6101
This commit is contained in:
Eric Evans 2013-10-03 09:40:39 -05:00
parent 31a9a2fd1e
commit 723abe2fc2
2 changed files with 6 additions and 19 deletions

View File

@ -18,3 +18,5 @@ done
for jar in /usr/share/cassandra/*.jar; do
CLASSPATH=$CLASSPATH:$jar
done
CLASSPATH="$CLASSPATH:$EXTRA_CLASSPATH"

23
debian/init vendored
View File

@ -77,26 +77,9 @@ fi
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
# If JNA is installed, add it to EXTRA_CLASSPATH
#
# Function that returns the applications classpath
#
classpath()
{
cp="$EXTRA_CLASSPATH"
for j in /usr/share/$NAME/lib/*.jar; do
[ "x$cp" = "x" ] && cp=$j || cp=$cp:$j
done
for j in /usr/share/$NAME/*.jar; do
[ "x$cp" = "x" ] && cp=$j || cp=$cp:$j
done
# use JNA if installed in standard location
[ -r /usr/share/java/jna.jar ] && cp="$cp:/usr/share/java/jna.jar"
# Include the conf directory for purposes of log4j-server.properties, and
# commons-daemon in support of the daemonization class.
printf "$cp:$CONFDIR:/usr/share/java/commons-daemon.jar"
}
EXTRA_CLASSPATH="/usr/share/java/jna.jar:$EXTRA_CLASSPATH"
#
# Function that returns 0 if process is running, or nonzero if not.
@ -136,6 +119,8 @@ do_start()
[ -e `dirname "$PIDFILE"` ] || \
install -d -ocassandra -gcassandra -m750 `dirname $PIDFILE`
export EXTRA_CLASSPATH
start-stop-daemon -S -c cassandra -a /usr/sbin/cassandra -q -p "$PIDFILE" -t >/dev/null || return 1
start-stop-daemon -S -c cassandra -a /usr/sbin/cassandra -b -p "$PIDFILE" -- \