# start/stop/restart the jetty service for p4-search JAVA=$(which java) ROOT=$(dirname $0) TIMEOUT=30 JPORT=8088 STOP=8079 STOPKEY=stopkey if type netcat 2> /dev/null 1> /dev/null; then NETCAT=$(which netcat) elif type nc 2> /dev/null 1> /dev/null; then NETCAT=$(which nc) fi tryOnce() { ${NETCAT} -z localhost $JPORT return $? } portReachable() { # wait for 1 minute, then give up for i in $(seq 1 60); do tryOnce if [ $? -eq "0" ]; then return 0 else echo -n "." sleep 1 fi done return 1 } case "$1" in start) echo -n "Starting p4-search: " $JAVA -Xmx1G -Djetty.home=$ROOT -Djetty.port=$JPORT -Dsearch.configfile=file:$ROOT/$JETTY_PATH/resources/search.config -Dlog4j.configuration=file:$ROOT/$JETTY_PATH/resources/log4j.properties -DSTOP.PORT=$STOP -DSTOP.KEY=$STOPKEY -jar $ROOT/start.jar 1> start.log & sleep 1 if portReachable then RETVAL=0 echo "OK" else RETVAL=1 echo "FAILED" fi ;; stop) if tryOnce ; then echo -n "Stopping p4-search: " $JAVA -Djetty.home=$ROOT -DSTOP.PORT=$STOP -DSTOP.KEY=$STOPKEY -jar $ROOT/start.jar --stop sleep 1 if tryOnce ; then echo FAILED else echo OK fi RETVAL=$? else echo "not running" fi ;; status) if tryOnce ; then echo "running" else echo "stopped" fi RETVAL=$? ;; restart) $0 stop $0 start RETVAL=$? ;; *) echo "Usage: p4search-control.sh {start|stop|status|restart}" exit 1 esac exit $RETVAL
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 8568 | jayesh_mistry | Populate //guest/jayesh_mistry/p4-search/.... | ||
//guest/doug_scheirer/p4-search/search/build/scripts/p4search-control.sh | |||||
#2 | 8501 | Doug Scheirer |
* updating to gradlew for build * make (more) Mac compatible build process * default port for default install is now 8088 * updated API doc to include the queryRaw param on POSTs * minor bug fixes for when the p4d connection drops while indexing |
||
#1 | 8476 | Doug Scheirer | p4-search copy from //depot/main/p4-search |