From e43ee6fd8138e14f968298d13a5a5c108ef69e95 Mon Sep 17 00:00:00 2001 From: Eric Evans Date: Fri, 19 Feb 2010 21:30:36 +0000 Subject: [PATCH] start avro daemon using -a arg to startup script Patch by eevans; reviewed by gdusbabek for CASSANDRA-811 git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@911990 13f79535-47bb-0310-9956-ffa450edef68 --- bin/cassandra | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/bin/cassandra b/bin/cassandra index 6c6d74cbea..896c81db09 100755 --- a/bin/cassandra +++ b/bin/cassandra @@ -103,6 +103,7 @@ launch_service() pidpath=$1 foreground=$2 props=$3 + class=$4 cassandra_parms="-Dstorage-config=$CASSANDRA_CONF" if [ "x$pidpath" != "x" ]; then @@ -113,12 +114,10 @@ launch_service() # to close stdout/stderr, but it's up to us not to background. if [ "x$foreground" != "x" ]; then cassandra_parms="$cassandra_parms -Dcassandra-foreground=yes" - $JAVA $JVM_OPTS $cassandra_parms -cp $CLASSPATH $props \ - org.apache.cassandra.thrift.CassandraDaemon + $JAVA $JVM_OPTS $cassandra_parms -cp $CLASSPATH $props $class # Startup CassandraDaemon, background it, and write the pid. else - exec $JAVA $JVM_OPTS $cassandra_parms -cp $CLASSPATH $props \ - org.apache.cassandra.thrift.CassandraDaemon <&- & + exec $JAVA $JVM_OPTS $cassandra_parms -cp $CLASSPATH $props $class <&- & [ ! -z $pidpath ] && printf "%d" $! > $pidpath fi @@ -126,9 +125,11 @@ launch_service() } # Parse any command line options. -args=`getopt fhp:bD: "$@"` +args=`getopt fahp:bD: "$@"` eval set -- "$args" +classname="org.apache.cassandra.thrift.CassandraDaemon" + while true; do case "$1" in -p) @@ -147,6 +148,10 @@ while true; do properties="$properties -D$2" shift 2 ;; + -a) + classname="org.apache.cassandra.avro.CassandraDaemon" + shift + ;; --) shift break @@ -159,7 +164,7 @@ while true; do done # Start up the service -launch_service "$pidfile" "$foreground" "$properties" +launch_service "$pidfile" "$foreground" "$properties" "$classname" exit $?