cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject svn commit: r1038863 - in /cassandra/branches/cassandra-0.7: CHANGES.txt debian/init
Date Wed, 24 Nov 2010 23:02:09 GMT
Author: eevans
Date: Wed Nov 24 23:02:09 2010
New Revision: 1038863

URL: http://svn.apache.org/viewvc?rev=1038863&view=rev
Log:
wait for up to 10 secs for process to start

Patch by paul cannon; reviewed by eevans for CASSANDRA-1772

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    cassandra/branches/cassandra-0.7/debian/init

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1038863&r1=1038862&r2=1038863&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Wed Nov 24 23:02:09 2010
@@ -10,6 +10,7 @@ dev
  * fix add/remove index bugs in CFMetadata (CASSANDRA-1768)
  * rebuild Strategy during system_update_keyspace (CASSANDRA-1762)
  * cli updates prompt to ... in continuation lines (CASSANDRA-1770)
+ * improvements to Debian init script (CASSANDRA-1772)
 
 
 0.7.0-rc1

Modified: cassandra/branches/cassandra-0.7/debian/init
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/debian/init?rev=1038863&r1=1038862&r2=1038863&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/debian/init (original)
+++ cassandra/branches/cassandra-0.7/debian/init Wed Nov 24 23:02:09 2010
@@ -18,6 +18,7 @@ PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 CONFDIR=/etc/cassandra
 JSVC=/usr/bin/jsvc
+WAIT_FOR_START=10
 
 # The first existing directory is used for JAVA_HOME if needed.
 JVM_SEARCH_DIRS="/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun"
@@ -93,12 +94,12 @@ classpath()
 # process is not running but the pidfile exists (to match the exit codes for
 # the "status" command; see LSB core spec 3.1, section 20.2)
 #
-CMD_PATT="^`basename $JSVC`\.exec.*$NAME"
+CMD_PATT="-user.cassandra.+CassandraDaemon"
 is_running()
 {
     if [ -f $PIDFILE ]; then
         pid=`cat $PIDFILE`
-        grep -q "$CMD_PATT" "/proc/$pid/cmdline" 2>/dev/null && return 0
+        grep -Eq "$CMD_PATT" "/proc/$pid/cmdline" 2>/dev/null && return 0
         return 1
     fi
     return 3
@@ -126,7 +127,12 @@ do_start()
         $JVM_OPTS \
         org.apache.cassandra.thrift.CassandraDaemon
 
-    if ! is_running; then return 2; fi
+    is_running && return 0
+    for tries in `seq $WAIT_FOR_START`; do
+        sleep 1
+        is_running && return 0
+    done
+    return 2
 }
 
 #



Mime
View raw message