summaryrefslogtreecommitdiff
path: root/textproc/apache-solr/files
diff options
context:
space:
mode:
Diffstat (limited to 'textproc/apache-solr/files')
-rw-r--r--textproc/apache-solr/files/patch-bind-localhost.patch18
-rw-r--r--textproc/apache-solr/files/pkg-install.in22
-rw-r--r--textproc/apache-solr/files/pkg-message.in31
-rw-r--r--textproc/apache-solr/files/solr.in30
4 files changed, 95 insertions, 6 deletions
diff --git a/textproc/apache-solr/files/patch-bind-localhost.patch b/textproc/apache-solr/files/patch-bind-localhost.patch
new file mode 100644
index 000000000000..a65161ec5a35
--- /dev/null
+++ b/textproc/apache-solr/files/patch-bind-localhost.patch
@@ -0,0 +1,18 @@
+--- server/etc/jetty-http.xml.bak 2016-09-01 16:16:13.027176858 +0200
++++ server/etc/jetty-http.xml 2016-09-01 16:16:40.498173610 +0200
+@@ -33,7 +33,7 @@
+ </Item>
+ </Array>
+ </Arg>
+- <Set name="host"><Property name="jetty.host" /></Set>
++ <Set name="host"><Property name="jetty.host" default="localhost" /></Set>
+ <Set name="port"><Property name="jetty.port" default="8983" /></Set>
+ <Set name="idleTimeout"><Property name="solr.jetty.http.idleTimeout" default="50000"/></Set>
+ <Set name="soLingerTime"><Property name="solr.jetty.http.soLingerTime" default="-1"/></Set>
+@@ -44,4 +44,4 @@
+ </Arg>
+ </Call>
+
+-</Configure>
+\ No newline at end of file
++</Configure>
diff --git a/textproc/apache-solr/files/pkg-install.in b/textproc/apache-solr/files/pkg-install.in
new file mode 100644
index 000000000000..f49b6863f18a
--- /dev/null
+++ b/textproc/apache-solr/files/pkg-install.in
@@ -0,0 +1,22 @@
+#! /bin/sh
+#
+PATH=/bin:/usr/bin:/usr/sbin
+
+set -e
+case "$2" in
+
+POST-INSTALL)
+ echo "---> Starting post-install script"
+ LC_ALL=C
+ export LC_ALL
+
+ echo "Fix permissions"
+ /usr/sbin/chown -R solr /var/db/solr
+ /usr/bin/chgrp -R solr /var/db/solr
+ /usr/sbin/chown -R solr /var/log/solr
+ /usr/bin/chgrp -R solr /var/log/solr
+ echo "done."
+ echo ""
+
+ ;;
+esac
diff --git a/textproc/apache-solr/files/pkg-message.in b/textproc/apache-solr/files/pkg-message.in
new file mode 100644
index 000000000000..f0f919a1a3bf
--- /dev/null
+++ b/textproc/apache-solr/files/pkg-message.in
@@ -0,0 +1,31 @@
+=======================================================================
+
+Make sure to edit the following files to adapt to your setup:
+
+%%LOCALBASE%%/etc/solr.in.sh
+/var/db/solr/solr.xml
+/var/db/solr/log4j.properties
+
+All files are configured to have your solr instances running in
+/var/db/solr/<instancename>
+
+For more information how to configure solr check the manual:
+http://lucene.apache.org/solr/resources.html#documentation
+
+The port is configured to listen only on localhost, port 8983.
+
+To have a working initial config, use:
+
+cp -R %%LOCALBASE%%/solr/example/example-DIH/solr/solr /var/db/solr/
+chown -R www /var/db/solr/solr
+
+To rotate solr log files include /var/log/solr/ to your log rotation
+configuration.
+
+To enable the port execute:
+sysrc solr_enable="YES"
+
+And start it with:
+service solr start
+
+=======================================================================
diff --git a/textproc/apache-solr/files/solr.in b/textproc/apache-solr/files/solr.in
index d45da8e6c960..fca76efb9a1a 100644
--- a/textproc/apache-solr/files/solr.in
+++ b/textproc/apache-solr/files/solr.in
@@ -39,12 +39,30 @@ load_rc_config $name
: ${solr_enable:=NO}
: ${solr_instance:=/var/db/solr}
-required_files=${solr_instance}/solr.xml
-pidfile=/var/run/solr.pid
-command=/usr/sbin/daemon
-procname=`env JAVAVM_DRYRUN=true JAVA_VERSION=1.7+ %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -f 2 -d =`
-start_precmd="cd %%EXAMPLESDIR%%"
+solr_start ()
+{
+ su -m solr -c "${command} start"
+}
-command_args="-f -p ${pidfile} ${procname} ${solr_flags} -Dsolr.solr.home=${solr_instance} -Dsolr.log=/var/log -jar %%EXAMPLESDIR%%/start.jar"
+solr_stop ()
+{
+ su -m solr -c "${command} stop"
+}
+
+solr_status ()
+{
+ su -m solr -c "${command} status"
+}
+
+# add %%PREFIX%%/bin to path
+export PATH=$PATH:%%PREFIX%%/bin
+# let the start script read some custom settings
+export SOLR_INCLUDE=/usr/local/etc/solr.in.sh
+
+required_files="${solr_instance}/solr.xml /usr/local/etc/solr.in.sh ${solr_instance}/log4j.properties"
+command=%%PREFIX%%/solr/bin/solr
+start_cmd=solr_start
+stop_cmd=solr_stop
+status_cmd=solr_status
run_rc_command "$1"