# 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 | 18494 | Paul Allen |
Fixed paths: search/search/... to search/... util/util/... to util/... Fixed permission bits +w for config and properties file that get touched during build/install Fixed INSTALL file and install dir (cause name clash on OS X) moved INSTALL to INSTALL.md |
||
//guest/perforce_software/p4search/main/search/search/build/scripts/p4search-control.sh | |||||
#1 | 16193 | perforce_software | Move p4search to main directory to match new branching path scheme. | ||
//guest/perforce_software/p4search/search/build/scripts/p4search-control.sh | |||||
#1 | 8975 | Matt Attaway | Populate official version of p4-search from the original Doug Scheirer source |