Line 0
Link Here
|
|
|
1 |
#!/bin/sh |
2 |
# |
3 |
# Copyright (c) 2014, Radim Kolar |
4 |
# All rights reserved. |
5 |
# |
6 |
# Redistribution and use in source and binary forms, with or without |
7 |
# modification, are permitted provided that the following conditions are met: |
8 |
# |
9 |
# * Redistributions of source code must retain the above copyright notice, |
10 |
# this list of conditions and the following disclaimer. |
11 |
# * Redistributions in binary form must reproduce the above copyright |
12 |
# notice, this list of conditions and the following disclaimer in the |
13 |
# documentation and/or other materials provided with the distribution. |
14 |
# |
15 |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY |
16 |
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
17 |
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
18 |
# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY |
19 |
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
20 |
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
21 |
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
22 |
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
23 |
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
24 |
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH |
25 |
# DAMAGE. |
26 |
|
27 |
# $FreeBSD$ |
28 |
# |
29 |
# PROVIDE: solr |
30 |
# REQUIRE: LOGIN |
31 |
# KEYWORD: shutdown |
32 |
|
33 |
. /etc/rc.subr |
34 |
|
35 |
name=solr |
36 |
rcvar=solr_enable |
37 |
load_rc_config $name |
38 |
|
39 |
: ${solr_enable:=NO} |
40 |
: ${solr_instance:=/var/db/solr} |
41 |
|
42 |
required_files=${solr_instance}/solr.xml |
43 |
pidfile=/var/run/solr.pid |
44 |
command=/usr/sbin/daemon |
45 |
procname=%%LOCALBASE%%/openjdk7/bin/java |
46 |
start_precmd="cd %%EXAMPLESDIR%%" |
47 |
|
48 |
command_args="-f -p ${pidfile} ${procname} ${solr_flags} -Dsolr.solr.home=${solr_instance} -Dsolr.log=/var/log -jar %%EXAMPLESDIR%%/start.jar" |
49 |
|
50 |
run_rc_command "$1" |