-
-
Save bejean/77043d1446778a9e8fcf to your computer and use it in GitHub Desktop.
solr init.d script pour Centos
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 | |
# | |
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested with Centos