Skip to content

Instantly share code, notes, and snippets.

@bejean
Last active August 29, 2015 14:08
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 bejean/77043d1446778a9e8fcf to your computer and use it in GitHub Desktop.
Save bejean/77043d1446778a9e8fcf to your computer and use it in GitHub Desktop.
solr init.d script pour Centos
#! /bin/sh
#
# chkconfig: 2345 90 10
# description: solr daemon
. /etc/init.d/functions
# You will probably want to change only two following lines.
BASEDIR="/opt/solr"
USER="root"
PROG="solr"
CMD="bin/solr"
RETVAL=0
start () {
echo -n $"Starting ${PROG}: "
runuser ${USER} -c "cd ${BASEDIR}
${CMD} start > /dev/null &"
echo
}
stop () {
echo -n $"Stopping ${PROG}: "
runuser ${USER} -c "cd ${BASEDIR}
${CMD} stop > /dev/null &"
echo
}
restart () {
stop
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|status}"
RETVAL=2
;;
esac
exit $RETVAL
@bejean
Copy link
Author

bejean commented Oct 23, 2014

Tested with Centos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment