|
| 1 | +#!/bin/bash |
| 2 | +export PID=$$ |
| 3 | + |
| 4 | +if test -n "$ORIGINAL_PATH"; then |
| 5 | + # running in cygwin... |
| 6 | + PS='\' |
| 7 | + export EXT=".exe" |
| 8 | +else |
| 9 | + export EXT="" |
| 10 | + PS='/' |
| 11 | +fi; |
| 12 | + |
| 13 | +SCRIPT="utils${PS}generateExamples.js" |
| 14 | +LOGFILE="out${PS}log-$PID" |
| 15 | +DBDIR="out${PS}data-$PID" |
| 16 | + |
| 17 | +mkdir -p ${DBDIR} |
| 18 | + |
| 19 | +echo Database has its data in ${DBDIR} |
| 20 | +echo Logfile is in ${LOGFILE} |
| 21 | + |
| 22 | +if [ -z "${ARANGOD}" ]; then |
| 23 | + if [ -x build/bin/arangod ]; then |
| 24 | + ARANGOD=build/bin/arangod |
| 25 | + elif [ -x bin/arangosh ]; then |
| 26 | + ARANGOD=bin/arangod |
| 27 | + else |
| 28 | + echo "$0: cannot locate arangod" |
| 29 | + fi |
| 30 | +fi |
| 31 | + |
| 32 | +${ARANGOD} \ |
| 33 | + --configuration none \ |
| 34 | + --cluster.agent-path bin${PS}etcd-arango${EXT} \ |
| 35 | + --cluster.arangod-path bin${PS}arangod \ |
| 36 | + --cluster.coordinator-config etc${PS}relative${PS}arangod-coordinator.conf \ |
| 37 | + --cluster.dbserver-config etc${PS}relative${PS}arangod-dbserver.conf \ |
| 38 | + -
AFBB
-cluster.disable-dispatcher-frontend false \ |
| 39 | + --cluster.disable-dispatcher-kickstarter false \ |
| 40 | + --cluster.data-path cluster \ |
| 41 | + --cluster.log-path cluster \ |
| 42 | + --database.directory ${DBDIR} \ |
| 43 | + --log.file ${LOGFILE} \ |
| 44 | + --server.endpoint tcp://127.0.0.1:$PORT \ |
| 45 | + --javascript.startup-directory js \ |
| 46 | + --javascript.app-path js${PS}apps \ |
| 47 | + --javascript.script $SCRIPT \ |
| 48 | + --no-server \ |
| 49 | + --temp-path ${PS}var${PS}tmp \ |
| 50 | + "${ARGS[@]}" \ |
| 51 | + |
| 52 | +if test $? -eq 0; then |
| 53 | + echo "removing ${LOGFILE} ${DBDIR}" |
| 54 | + rm -rf ${LOGFILE} ${DBDIR} |
| 55 | +else |
| 56 | + echo "failed - don't remove ${LOGFILE} ${DBDIR} - here's the logfile:" |
| 57 | + cat ${LOGFILE} |
| 58 | +fi |
| 59 | + |
| 60 | +echo Server has terminated. |
0 commit comments