Permalink
Browse files

The script now waits for jackrabbit to reply when starting up

  • Loading branch information...
1 parent e3e2b8e commit 4b4c38e70df930307d4b743f79c673379abcf800 Daniel Barsotti committed Nov 16, 2011
Showing with 5 additions and 1 deletion.
  1. +2 −0 .gitignore
  2. +3 −1 jackrabbit.sh
View
@@ -1,5 +1,7 @@
jackrabbit-standalone*.jar
jackrabbit/
+jackrabbit.log
+jackrabbit.pid
jmx.role
jmx.user
View
@@ -59,7 +59,9 @@ LOGFILE=$BASEDIR/jackrabbit.log
do_start() {
if [ ! -f $PIDFILE ]; then
cd $BASEDIR
- nohup java $MEMORY $MANAGEMENT -jar $JACKRABBIT_JAR -h $JACKRABBIT_HOST -p $JACKRABBIT_PORT >> $LOGFILE 2>&1 & echo $! > $PIDFILE
+ nohup java $MEMORY $MANAGEMENT -jar $JACKRABBIT_JAR -h $JACKRABBIT_HOST -p $JACKRABBIT_PORT >> $LOGFILE 2>&1 & echo $! > $PIDFILE
+ # Wait until the server is ready (from an idea of <chluehr> on FreeNode)
+ while [[ -z `curl -s "http://$JACKRABBIT_HOST:$JACKRABBIT_PORT"` ]] ; do sleep 1s; echo -n "."; done
echo "Jackrabbit started"
else
echo "Jackrabbit is already running"

0 comments on commit 4b4c38e

Please sign in to comment.