add start/stop targets
authorWolfram Schneider <wosch@indexdata.dk>
Tue, 3 Sep 2013 09:58:55 +0000 (09:58 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Tue, 3 Sep 2013 09:58:55 +0000 (09:58 +0000)
zebra/Makefile

index 2c8cacd..2c16619 100644 (file)
@@ -6,6 +6,9 @@ ZEBRA_DIR=              db
 ZEBRAIDX=              zebraidx-2.0 
 ZEBRAIDX_TEST=         zebraidx-2.0 -c zebra-test.cfg
 IRSPY_DATABASE=                $${IRSpyDbName-"localhost:8018/IR-Explain---1"}
+ZEBRA_LOGFILE=         irspy-zebra.log
+ZEBRA_PID_FILE=                ${ZEBRA_DIR}/lock/zebrasrv.pid
+
 
 # debugging
 ZEBRA_TEST_DIR=                db-test
@@ -49,9 +52,19 @@ dump:
 clean:
        rm -f terse.properties
 
+start-zebra:
+       zebrasrv-2.0 -f yazserver.xml > ${ZEBRA_LOGFILE} 2>&1 &
+
+stop-zebra:
+       kill `cat ${ZEBRA_PID_FILE}`
+       sleep 0.5
+       -kill -9 `cat ${ZEBRA_PID_FILE}`
+
 distclean: clean
-       rm -rf ${IRSPY_ARCHIVE} ${ZEBRA_DIR} ${ZEBRA_DIR} ${ZEBRA_TEST_DIR}
+       rm -rf ${IRSPY_ARCHIVE} ${ZEBRA_DIR} ${ZEBRA_DIR} ${ZEBRA_TEST_DIR} ${ZEBRA_LOGFILE}
 
 help:
-       @echo "make [ dump | test | newdb | newdb-test | clean | distclean ]"
+       @echo "make [ dump | test | newdb | newdb-test ]"
+       @echo "     [ start-zebra | stop-zebra ]"
+       @echo "     [ clean | distclean ]"