Created
October 15, 2014 15:48
-
-
Save gerard-kanters/6a7fb12559bae9f0a5cd to your computer and use it in GitHub Desktop.
solr.start (put in /var/lib/)
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/bash | |
#----------------------------------------------------- | |
# solr-initd v0.5.1 | |
#----------------------------------------------------- | |
# Starts solr and writes a pid file. Meant | |
# to be used with the initd script but this | |
# can be used on it's own | |
# | |
# Requires /etc/solr.conf | |
# Usage: ./solr.start | |
# | |
#----------------------------------------------------- | |
if [ ! -f /etc/solr.conf ]; then | |
echo "Missing config file /etc/solr.conf" | |
exit 1 | |
fi | |
. /etc/solr.conf | |
if [ ! -d $SOLR_HOME ]; then | |
echo "Can't find $SOLR_HOME" | |
exit 1 | |
fi | |
cd $SOLR_HOME | |
COMMAND="java $OPTIONS -jar start.jar" | |
nohup $COMMAND > $LOG_FILE 2>&1 & | |
echo $! > $PIDFILE | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment