-
-
Save bullfinch3000/1339620 to your computer and use it in GitHub Desktop.
init.d script for Solr on Amazon Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
# Starts, stops, and restarts solr | |
SOLR_DIR=/usr/local/lib/solr/example | |
JAVA_OPTIONS="-Xmx1024m -DSTOP.PORT=8079 -DSTOP.KEY=stopkey -jar start.jar" | |
LOG_FILE=/var/log/solr.log | |
JAVA=`which java` | |
case $1 in | |
start) | |
echo "Starting Solr" | |
cd $SOLR_DIR | |
$JAVA $JAVA_OPTIONS 2> $LOG_FILE & | |
;; | |
stop) | |
echo "Stopping Solr" | |
cd $SOLR_DIR | |
$JAVA $JAVA_OPTIONS --stop | |
;; | |
restart) | |
$0 stop | |
sleep 1 | |
$0 start | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart}" >&2 | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simple script for starting and stopping Solr using /etc/init.d/solr
Requires a Solr build being available on /usr/local/lib/solr