-echo " starting server..."
-../../index/zebrasrv -S -c zebra2.cfg -l srv.log tcp:@:9901 &
-sleep 1
-test -f zebrasrv.pid || exit 1
+rm -f $LOG
+
+echo " init..." >>$LOG
+rm -f $pp/records/esdd000[12].grs # these should not be here, will be created later
+../../index/zebraidx -c $pp/zebra2.cfg -l $LOG init || exit 1
+
+echo " starting server..." >>$LOG
+../../index/zebrasrv -D -p z.pid -S -c $pp/zebra2.cfg -l $LOG unix:socket
+test -f z.pid || exit 1