-
-
Save chrisnharvey/9a4a8196b1666183eafd to your computer and use it in GitHub Desktop.
Solr init.d script
This file contains 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 | |
# Starts, stops, and restarts Apache Solr. | |
# | |
# chkconfig: 35 92 08 | |
# description: Starts and stops Apache Solr | |
SOLR_DIR="/var/solr" | |
JAVA_OPTIONS="-Xmx1024m -DSTOP.PORT=8079 -DSTOP.KEY=mustard -jar start.jar" | |
LOG_FILE="/var/log/solr.log" | |
JAVA="/usr/bin/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment