Skip to content

Instantly share code, notes, and snippets.

@gerard-kanters
Created October 15, 2014 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerard-kanters/6a7fb12559bae9f0a5cd to your computer and use it in GitHub Desktop.
Save gerard-kanters/6a7fb12559bae9f0a5cd to your computer and use it in GitHub Desktop.
solr.start (put in /var/lib/)
#!/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