Gentoo Archives: gentoo-commits

From: Amy Liffey <amynka@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/elasticsearch/, app-misc/elasticsearch/files/
Date: Sat, 25 Nov 2017 13:22:49
Message-Id: 1511616152.b6022616f6caeb4d701bc0e2162e91e0127f1e84.amynka@gentoo
1 commit: b6022616f6caeb4d701bc0e2162e91e0127f1e84
2 Author: Tomáš Mózes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Sat Nov 25 03:09:11 2017 +0000
4 Commit: Amy Liffey <amynka <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 25 13:22:32 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b6022616
7
8 app-misc/elasticsearch: bump to 6.0.0
9
10 Closes:#6287
11
12 app-misc/elasticsearch/Manifest | 5 +-
13 app-misc/elasticsearch/elasticsearch-6.0.0.ebuild | 69 ++++++++++++++++++++++
14 app-misc/elasticsearch/files/elasticsearch.conf.3 | 62 +++++++++++++++++++
15 app-misc/elasticsearch/files/elasticsearch.init.3 | 61 +++++++++++++++++++
16 .../elasticsearch/files/elasticsearch.service.2 | 52 ++++++++++++++++
17 5 files changed, 247 insertions(+), 2 deletions(-)
18
19 diff --git a/app-misc/elasticsearch/Manifest b/app-misc/elasticsearch/Manifest
20 index ff083bca088..30de5e9c79e 100644
21 --- a/app-misc/elasticsearch/Manifest
22 +++ b/app-misc/elasticsearch/Manifest
23 @@ -1,2 +1,3 @@
24 -DIST elasticsearch-5.5.2.tar.gz 33485703 SHA256 0870e2c0c72e6eda976effa07aa1cdd06a9500302320b5c22ed292ce21665bf1 SHA512 62048f15b43e38a61e3a19a1599c25cd0d9009cc1172db5b450b04dec349ecd313b1f20e3d1c7ed1c101ae3e6f6c6d2cdf004a9713ad803576277f93e3adbdb9 WHIRLPOOL 3a71cef2858b76b11e1693907e745912a83f23e26c35a3456c6324fc19c317c53d4404e20134b034e41e162c1ea8d58c38bbd4afe0394d886ab32f6b698172ec
25 -DIST elasticsearch-5.6.4.tar.gz 33776770 SHA256 1098fc776fae8c74e65f8e17cf2ea244c1d07c4e6711340c9bb9f6df56aa45b0 SHA512 37730f39cf1711b6a20861370ef7aff4b48e7f90ad82cb1c8c92643179194c4dcdf0180691d8065304bf61e7f5a2fb1ed5c84c384e0b2ff7ad0dc58ac7352f47 WHIRLPOOL 37f1a615a7916738bb8f4809213edced96aaecf3d93df8cad0bc175c71191a6f1d3d616fc40b71e647b65e4c2e03f4f6ab9a4ff333b55d3728ca100b2181edbc
26 +DIST elasticsearch-5.5.2.tar.gz 33485703 BLAKE2B 96a9055041506c9e92d64f8922daeca5fcb45b0e1f34ff8a8aaf14024505bf7d2b8d786de40d267252c3354473ea6ca186cf75e8d994940b43459122a3931a0e SHA512 62048f15b43e38a61e3a19a1599c25cd0d9009cc1172db5b450b04dec349ecd313b1f20e3d1c7ed1c101ae3e6f6c6d2cdf004a9713ad803576277f93e3adbdb9
27 +DIST elasticsearch-5.6.4.tar.gz 33776770 BLAKE2B c74df8a496c30be315abfd7d1a71f7f8eb75de1a64a7ddd22ff742bd547ec38d417c1ce4002ed6c90b2716837ee0425cf87c910d9f810999e837d118268dcd66 SHA512 37730f39cf1711b6a20861370ef7aff4b48e7f90ad82cb1c8c92643179194c4dcdf0180691d8065304bf61e7f5a2fb1ed5c84c384e0b2ff7ad0dc58ac7352f47
28 +DIST elasticsearch-6.0.0.tar.gz 28017602 BLAKE2B cea47a17109eb5d46b1d94c3763f19923d97392c4a39a8dffb157b8ce60cf959e4680c2a54c5a9d204db64393f3f22dc52c0de94888753e817d808575ff352fd SHA512 25bb622d2fc557d8b8eded634a9b333766f7b58e701359e1bcfafee390776eb323cb7ea7a5e02e8803e25d8b1d3aabec0ec1b0cf492d0bab5689686fe440181c
29
30 diff --git a/app-misc/elasticsearch/elasticsearch-6.0.0.ebuild b/app-misc/elasticsearch/elasticsearch-6.0.0.ebuild
31 new file mode 100644
32 index 00000000000..aeab2b8db11
33 --- /dev/null
34 +++ b/app-misc/elasticsearch/elasticsearch-6.0.0.ebuild
35 @@ -0,0 +1,69 @@
36 +# Copyright 1999-2017 Gentoo Foundation
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=6
40 +
41 +inherit systemd user
42 +
43 +DESCRIPTION="Open Source, Distributed, RESTful, Search Engine"
44 +HOMEPAGE="https://www.elastic.co/products/elasticsearch"
45 +SRC_URI="https://artifacts.elastic.co/downloads/${PN}/${P}.tar.gz"
46 +LICENSE="Apache-2.0 BSD-2 LGPL-3 MIT public-domain"
47 +SLOT="0"
48 +KEYWORDS="~amd64"
49 +
50 +RDEPEND="virtual/jre:1.8"
51 +
52 +pkg_setup() {
53 + enewgroup ${PN}
54 + enewuser ${PN} -1 /bin/bash /usr/share/${PN} ${PN}
55 +}
56 +
57 +src_prepare() {
58 + rm -v bin/*.{bat,exe} LICENSE.txt || die
59 +
60 + default
61 +}
62 +
63 +src_install() {
64 + keepdir /etc/${PN}
65 + keepdir /etc/${PN}/scripts
66 +
67 + insinto /etc/${PN}
68 + doins config/*
69 + rm -rv config || die
70 +
71 + insinto /usr/share/${PN}
72 + doins -r ./*
73 +
74 + exeinto /usr/share/${PN}/bin
75 + doexe "${FILESDIR}/elasticsearch-systemd-pre-exec"
76 +
77 + chmod +x "${ED}"/usr/share/${PN}/bin/* || die
78 +
79 + keepdir /var/{lib,log}/${PN}
80 + fowners ${PN}:${PN} /var/{lib,log}/${PN}
81 + fperms 0750 /var/{lib,log}/${PN}
82 + dodir /usr/share/${PN}/plugins
83 +
84 + insinto /etc/sysctl.d
85 + newins "${FILESDIR}/${PN}.sysctl.d" ${PN}.conf
86 +
87 + newconfd "${FILESDIR}/${PN}.conf.3" ${PN}
88 + newinitd "${FILESDIR}/${PN}.init.3" ${PN}
89 +
90 + systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles.d" ${PN}.conf
91 + systemd_newunit "${FILESDIR}"/${PN}.service.2 ${PN}.service
92 +}
93 +
94 +pkg_postinst() {
95 + elog
96 + elog "You may create multiple instances of ${PN} by"
97 + elog "symlinking the init script:"
98 + elog "ln -sf /etc/init.d/${PN} /etc/init.d/${PN}.instance"
99 + elog
100 + elog "Please make sure you put elasticsearch.yml, log4j2.properties and scripts"
101 + elog "from /etc/elasticsearch into the configuration directory of the instance:"
102 + elog "/etc/${PN}/instance"
103 + elog
104 +}
105
106 diff --git a/app-misc/elasticsearch/files/elasticsearch.conf.3 b/app-misc/elasticsearch/files/elasticsearch.conf.3
107 new file mode 100644
108 index 00000000000..70c052a64cc
109 --- /dev/null
110 +++ b/app-misc/elasticsearch/files/elasticsearch.conf.3
111 @@ -0,0 +1,62 @@
112 +################################
113 +# Elasticsearch
114 +################################
115 +
116 +# Elasticsearch home directory
117 +#ES_HOME=/usr/share/elasticsearch
118 +
119 +# Elasticsearch Java path
120 +#JAVA_HOME=
121 +
122 +# Elasticsearch configuration directory
123 +#CONF_DIR=/etc/elasticsearch
124 +
125 +# Elasticsearch data directory
126 +#DATA_DIR=/var/lib/elasticsearch
127 +
128 +# Elasticsearch logs directory
129 +#LOG_DIR=/var/log/elasticsearch
130 +
131 +# Additional Java OPTS
132 +#ES_JAVA_OPTS=
133 +
134 +################################
135 +# Elasticsearch service
136 +################################
137 +
138 +# When executing the init script, this user will be used to run the elasticsearch service.
139 +# The default value is 'elasticsearch' and is declared in the init.d file.
140 +# Note that this setting is only used by the init script. If changed, make sure that
141 +# the configured user can read and write into the data, work, plugins and log directories.
142 +# For systemd service, the user is usually configured in file /usr/lib/systemd/system/elasticsearch.service
143 +#ES_USER=elasticsearch
144 +#ES_GROUP=elasticsearch
145 +
146 +# The number of seconds to wait before checking if Elasticsearch started successfully as a daemon process
147 +#ES_STARTUP_SLEEP_TIME=5
148 +
149 +################################
150 +# System properties
151 +################################
152 +
153 +# Specifies the maximum file descriptor number that can be opened by this process
154 +# When using Systemd, this setting is ignored and the LimitNOFILE defined in
155 +# /usr/lib/systemd/system/elasticsearch.service takes precedence
156 +MAX_OPEN_FILES=65536
157 +
158 +# The maximum number of bytes of memory that may be locked into RAM
159 +# Set to "unlimited" if you use the 'bootstrap.memory_lock: true' option
160 +# in elasticsearch.yml.
161 +# When using Systemd, the LimitMEMLOCK property must be set
162 +# in /usr/lib/systemd/system/elasticsearch.service
163 +MAX_LOCKED_MEMORY=unlimited
164 +
165 +# Maximum number of VMA (Virtual Memory Areas) a process can own
166 +# When using Systemd, this setting is ignored and the 'vm.max_map_count'
167 +# property is set at boot time in /usr/lib/sysctl.d/elasticsearch.conf
168 +#MAX_MAP_COUNT=262144
169 +
170 +# https://www.elastic.co/guide/en/elasticsearch/reference/master/max-number-of-threads.html
171 +MAX_THREADS=4096
172 +
173 +rc_ulimit="-l $MAX_LOCKED_MEMORY -n $MAX_OPEN_FILES -u $MAX_THREADS"
174
175 diff --git a/app-misc/elasticsearch/files/elasticsearch.init.3 b/app-misc/elasticsearch/files/elasticsearch.init.3
176 new file mode 100644
177 index 00000000000..ab086197ec9
178 --- /dev/null
179 +++ b/app-misc/elasticsearch/files/elasticsearch.init.3
180 @@ -0,0 +1,61 @@
181 +#!/sbin/openrc-run
182 +
183 +name="Elasticsearch"
184 +description="Elasticsearch Server"
185 +
186 +ES_INSTANCE=${SVCNAME#*.}
187 +
188 +if [ -n "${ES_INSTANCE}" ] && [ ${SVCNAME} != "elasticsearch" ]; then
189 + ES_BASE_PATH="/var/lib/elasticsearch/${ES_INSTANCE}"
190 + CONF_DIR="/etc/elasticsearch/${ES_INSTANCE}"
191 + LOG_DIR="/var/log/elasticsearch/${ES_INSTANCE}"
192 +else
193 + ES_BASE_PATH="/var/lib/elasticsearch/_default"
194 + CONF_DIR="/etc/elasticsearch"
195 + LOG_DIR="/var/log/elasticsearch/_default"
196 +fi
197 +
198 +ES_HOME=${ES_HOME:="/usr/share/elasticsearch"}
199 +ES_USER=${ES_USER:="elasticsearch"}
200 +ES_GROUP=${ES_GROUP:="elasticsearch"}
201 +ES_STARTUP_SLEEP_TIME=${ES_STARTUP_TIME:=5}
202 +MAX_OPEN_FILES=${MAX_OPEN_FILES:=65536}
203 +MAX_MAP_COUNT=${MAX_MAP_COUNT:=262144}
204 +
205 +DATA_DIR=${DATA_DIR:="${ES_BASE_PATH}/data"}
206 +
207 +if [ -f "${CONF_DIR}/elasticsearch.in.sh" ]; then
208 + ES_INCLUDE="${CONF_DIR}/elasticsearch.in.sh"
209 +fi
210 +
211 +export ES_INCLUDE
212 +export JAVA_HOME
213 +export JAVA_OPTS
214 +export ES_JVM_OPTIONS
215 +export ES_JAVA_OPTS
216 +export ES_STARTUP_SLEEP_TIME
217 +export ES_PATH_CONF="${CONF_DIR}"
218 +
219 +pidfile="/run/elasticsearch/${RC_SVCNAME}.pid"
220 +
221 +command="/usr/share/elasticsearch/bin/elasticsearch"
222 +command_args="--daemonize --pidfile=${pidfile} -Epath.logs=${LOG_DIR} -Epath.data=${DATA_DIR}"
223 +command_user="${ES_USER}:${ES_GROUP}"
224 +required_files="${CONF_DIR}/elasticsearch.yml"
225 +retry="TERM/30/KILL/30"
226 +
227 +depend() {
228 + use net
229 +}
230 +
231 +start_pre() {
232 + if [ -n "${MAX_MAP_COUNT}" -a -f /proc/sys/vm/max_map_count ]; then
233 + sysctl -q -w vm.max_map_count=${MAX_MAP_COUNT}
234 + fi
235 +
236 + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "/var/lib/elasticsearch"
237 + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "/var/log/elasticsearch"
238 + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "/run/elasticsearch"
239 + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "${ES_BASE_PATH}"
240 + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "${LOG_DIR}"
241 +}
242
243 diff --git a/app-misc/elasticsearch/files/elasticsearch.service.2 b/app-misc/elasticsearch/files/elasticsearch.service.2
244 new file mode 100644
245 index 00000000000..8db69326f26
246 --- /dev/null
247 +++ b/app-misc/elasticsearch/files/elasticsearch.service.2
248 @@ -0,0 +1,52 @@
249 +[Unit]
250 +Description=Elasticsearch
251 +Documentation=https://www.elastic.co
252 +Wants=network.target
253 +After=network.target
254 +
255 +[Service]
256 +Environment=ES_HOME=/usr/share/elasticsearch
257 +Environment=ES_PATH_CONF=/etc/elasticsearch
258 +Environment=DATA_DIR=/var/lib/elasticsearch
259 +Environment=LOG_DIR=/var/log/elasticsearch
260 +Environment=PID_DIR=/run/elasticsearch
261 +EnvironmentFile=-/etc/conf.d/elasticsearch
262 +
263 +WorkingDirectory=/usr/share/elasticsearch
264 +
265 +User=elasticsearch
266 +Group=elasticsearch
267 +
268 +ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec
269 +
270 +ExecStart=/usr/share/elasticsearch/bin/elasticsearch \
271 + -p ${PID_DIR}/elasticsearch.pid \
272 + -Epath.home=${ES_HOME} \
273 + -Epath.logs=${LOG_DIR} \
274 + -Epath.data=${DATA_DIR}
275 +
276 +StandardOutput=journal
277 +StandardError=inherit
278 +
279 +# Specifies the maximum file descriptor number that can be opened by this process
280 +LimitNOFILE=65536
281 +
282 +# Specifies the maximum number of bytes of memory that may be locked into RAM
283 +# Set to "infinity" if you use the 'bootstrap.memory_lock: true' option
284 +# in elasticsearch.yml and 'MAX_LOCKED_MEMORY=unlimited' in /etc/conf.d/elasticsearch
285 +#LimitMEMLOCK=infinity
286 +
287 +# Disable timeout logic and wait until process is stopped
288 +TimeoutStopSec=0
289 +
290 +# SIGTERM signal is used to stop the Java process
291 +KillSignal=SIGTERM
292 +
293 +# Java process is never killed
294 +SendSIGKILL=no
295 +
296 +# When a JVM receives a SIGTERM signal it exits with code 143
297 +SuccessExitStatus=143
298 +
299 +[Install]
300 +WantedBy=multi-user.target