Created
June 1, 2015 19:45
-
-
Save krusynth/7bc1169dad3e880061f7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 APACHE SOLR 4.10 | |
# | |
# chkconfig: 2345 85 15 | |
# description: Startup Script for APACHE SOLR 4.10 | |
# | |
# processname: solr | |
SOLR_BIN="/opt/solr/bin/solr" | |
SOLR_PORT="8983" | |
start() { | |
$SOLR_BIN start -p $SOLR_PORT | |
RETVAL=$? | |
return $RETVAL | |
} | |
stop() { | |
$SOLR_BIN stop -p $SOLR_PORT | |
RETVAL=$? | |
return $RETVAL | |
} | |
restart() { | |
$SOLR_BIN restart -p $SOLR_PORT | |
RETVAL=$? | |
return $RETVAL | |
} | |
status() { | |
$SOLR_BIN -i | |
RETVAL=$? | |
return $RETVAL | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
restart | |
;; | |
status) | |
status | |
;; | |
*) | |
echo "Usage: service solr {start|stop|restart|status}" | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment