summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /app-misc/elasticsearch/files
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'app-misc/elasticsearch/files')
-rw-r--r--app-misc/elasticsearch/files/elasticsearch.conf20
-rw-r--r--app-misc/elasticsearch/files/elasticsearch.init487
-rw-r--r--app-misc/elasticsearch/files/elasticsearch.service411
3 files changed, 118 insertions, 0 deletions
diff --git a/app-misc/elasticsearch/files/elasticsearch.conf b/app-misc/elasticsearch/files/elasticsearch.conf
new file mode 100644
index 000000000000..54e3df9a82dc
--- /dev/null
+++ b/app-misc/elasticsearch/files/elasticsearch.conf
@@ -0,0 +1,20 @@
+# please modify/copy
+# /etc/elasticsearch/elasticsearch.in.sh.sample
+# to
+# /etc/elasticsearch/[instance/]elasticsearch.in.sh
+#
+# many variables/options are available in this file
+
+# ES_USER="elasticsearch:elasticsearch"
+## set max fds (ulimit -n X)
+# ES_MAX_FD=""
+
+## override elasticsearch.in.sh
+#
+# ES_CLASSPATH=""
+# JAVA_OPTS=""
+# ES_JAVA_OPTS=""
+# ES_HEAP_SIZE=""
+# ES_HEAP_NEWSIZE=""
+# ES_DIRECT_SIZE=""
+# ES_USE_IPV4=""
diff --git a/app-misc/elasticsearch/files/elasticsearch.init4 b/app-misc/elasticsearch/files/elasticsearch.init4
new file mode 100644
index 000000000000..7110e584196e
--- /dev/null
+++ b/app-misc/elasticsearch/files/elasticsearch.init4
@@ -0,0 +1,87 @@
+#!/sbin/runscript
+
+name="Elasticsearch"
+description=""
+
+ES_USER=${ES_USER:="elasticsearch"}
+ES_INSTANCE=${SVCNAME#*.}
+
+if [ -n "${ES_INSTANCE}" ] && [ ${SVCNAME} != "elasticsearch" ]; then
+ PIDFILE="/run/elasticsearch/elasticsearch.${ES_INSTANCE}.pid"
+ ES_BASE_PATH="/var/lib/elasticsearch/${ES_INSTANCE}"
+ ES_CONF_PATH="/etc/elasticsearch/${ES_INSTANCE}"
+ ES_LOG_PATH="/var/log/elasticsearch/${ES_INSTANCE}"
+else
+ PIDFILE="/run/elasticsearch/elasticsearch.pid"
+ ES_BASE_PATH="/var/lib/elasticsearch/_default"
+ ES_CONF_PATH="/etc/elasticsearch"
+ ES_LOG_PATH="/var/log/elasticsearch/_default"
+fi
+
+ES_DATA_PATH="${ES_BASE_PATH}/data"
+ES_WORK_PATH="${ES_BASE_PATH}/work"
+
+export ES_INCLUDE="/usr/share/elasticsearch/bin/elasticsearch.in.sh"
+export JAVA_OPTS
+export ES_JAVA_OPTS
+export ES_HEAP_SIZE
+export ES_HEAP_NEWSIZE
+export ES_DIRECT_SIZE
+export ES_USE_IPV4
+
+server_command="/usr/share/elasticsearch/bin/elasticsearch"
+server_args=" -p ${PIDFILE} -Des.default.path.conf=\"${ES_CONF_PATH}\" -Des.default.path.data=\"${ES_DATA_PATH}\" -Des.default.path.work=\"${ES_WORK_PATH}\" -Des.default.path.logs=\"${ES_LOG_PATH}\""
+
+depend() {
+ use net
+}
+
+start() {
+ # elasticsearch -Des.config=/path/to/config/file
+ # elasticsearch -Des.network.host=10.0.0.4
+
+ [ ! -f "${ES_INCLUDE}" ] && {
+ eerror "${ES_INCLUDE} must be copied into place"
+ return 1
+ }
+
+ local conf
+ local conf_file
+ for conf in elasticsearch.yml logging.yml; do
+ conf_file="${ES_CONF_PATH}/${conf}"
+ if [ ! -f "${conf_file}" ]; then
+ eerror "${conf_file} must be copied into place"
+ return 1
+ fi
+ done
+
+ ebegin "Starting ${SVCNAME}"
+
+ if [ -n "${ES_MAX_FD}" ]; then
+ ulimit -n ${ES_MAX_FD}
+ einfo "Max open filedescriptors : ${ES_MAX_FD}"
+ fi
+
+ checkpath -d -o "${ES_USER}" -m750 "/var/lib/elasticsearch"
+ checkpath -d -o "${ES_USER}" -m750 "/var/log/elasticsearch"
+ checkpath -d -o "${ES_USER}" -m750 "$(dirname "${PIDFILE}")"
+ checkpath -d -o "${ES_USER}" -m750 "${ES_BASE_PATH}"
+ checkpath -d -o "${ES_USER}" -m750 "${ES_LOG_PATH}"
+
+ start-stop-daemon --start \
+ --background \
+ --chdir "${ES_BASE_PATH}" \
+ --user="${ES_USER}" \
+ --pidfile="${PIDFILE}" \
+ --exec ${server_command} -- ${server_args}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop \
+ --pidfile=${PIDFILE} \
+ --user="${ES_USER}" \
+ --retry=TERM/20/KILL/5
+ eend $?
+}
diff --git a/app-misc/elasticsearch/files/elasticsearch.service4 b/app-misc/elasticsearch/files/elasticsearch.service4
new file mode 100644
index 000000000000..739c6f8888bf
--- /dev/null
+++ b/app-misc/elasticsearch/files/elasticsearch.service4
@@ -0,0 +1,11 @@
+[Unit]
+Description=Elasticsearch
+After=network.target
+
+[Service]
+User=elasticsearch
+Environment=ES_INCLUDE=/usr/share/elasticsearch/bin/elasticsearch.in.sh
+ExecStart=/usr/share/elasticsearch/bin/elasticsearch -Des.default.path.conf=/etc/elasticsearch
+
+[Install]
+WantedBy=multi-user.target