Last active
March 26, 2016 20:49
-
-
Save turboezh/8285267 to your computer and use it in GitHub Desktop.
Apache solr gentoo openrc init.d script
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
#!/sbin/runscript | |
NAME=solr | |
# customize path | |
SOLR_PATH=/opt/solr/example | |
COMMAND=java | |
OPTIONS="-Dsolr.solr.home=$SOLR_PATH/solr -Djetty.home=$SOLR_PATH -jar $SOLR_PATH/start.jar" | |
PIDFILE=/var/run/$NAME.pid | |
depend() { | |
#(Dependency information) | |
need net | |
} | |
start() { | |
#(Commands necessary to start the service) | |
#if [ "${RC_CMD}" = "restart" ]; | |
#then | |
# Do something in case a restart requires more than stop, start | |
#fi | |
ebegin "Starting $NAME" | |
start-stop-daemon --start --background \ | |
--name $NAME \ | |
--chdir $SOLR_PATH \ | |
--pidfile $PIDFILE \ | |
--make-pidfile \ | |
--exec $COMMAND -- $OPTIONS | |
eend $? | |
} | |
stop() { | |
#(Commands necessary to stop the service) | |
ebegin "Stopping $NAME" | |
start-stop-daemon --stop \ | |
--name $NAME \ | |
--pidfile $PIDFILE | |
eend $? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment