From b7ebc951da8800f711142f69d9d958bde67a112d Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 28 Apr 2019 09:54:45 +0100 Subject: gentoo resync : 28.04.2019 --- app-misc/elasticsearch/Manifest | 11 ++- app-misc/elasticsearch/elasticsearch-5.6.15.ebuild | 69 ---------------- app-misc/elasticsearch/elasticsearch-5.6.16.ebuild | 69 ++++++++++++++++ app-misc/elasticsearch/elasticsearch-6.7.1.ebuild | 91 ++++++++++++++++++++++ app-misc/elasticsearch/elasticsearch-7.0.0.ebuild | 91 ++++++++++++++++++++++ app-misc/elasticsearch/files/elasticsearch.init.6 | 69 ++++++++++++++++ 6 files changed, 329 insertions(+), 71 deletions(-) delete mode 100644 app-misc/elasticsearch/elasticsearch-5.6.15.ebuild create mode 100644 app-misc/elasticsearch/elasticsearch-5.6.16.ebuild create mode 100644 app-misc/elasticsearch/elasticsearch-6.7.1.ebuild create mode 100644 app-misc/elasticsearch/elasticsearch-7.0.0.ebuild create mode 100644 app-misc/elasticsearch/files/elasticsearch.init.6 (limited to 'app-misc/elasticsearch') diff --git a/app-misc/elasticsearch/Manifest b/app-misc/elasticsearch/Manifest index 13ab523a0d30..c5d6b20f0735 100644 --- a/app-misc/elasticsearch/Manifest +++ b/app-misc/elasticsearch/Manifest @@ -3,14 +3,21 @@ AUX elasticsearch.conf.2 2070 BLAKE2B b620bc7bddfb57c0d1c409c8af919c85fd28df79fe AUX elasticsearch.conf.3 2196 BLAKE2B e711aa58eca0df5857fa48a4dc21f5dd144977f3cd0209a58c15868531a108175ecdd21ddc18e1daf1e83c0bbd26da7c00b260698b3ef87c938b6d18928df733 SHA512 36a98d788cff404ccfe0fdff7bbe358750df8db9e5a5f419991b90e257e97331ec93c5f9a84bed57099dd239abb572ef450a191582e7145d8d7517c242707e49 AUX elasticsearch.init.2 1830 BLAKE2B 57dea653c636c7ccb40fa6ab777f0713b245bf9d344b39de23aaaad753c229196cb81acd01c4ac1c9ae29c166b1dbfa38e829d60172106dbc384aeb6e21a544e SHA512 babc54a225f1ea5c98a6c2e0a680635a5af30305a869e35db65f5f6ddeb00577b3011f83b3190567646b7d67a314710c83212a233dc31a0fb78691eb1358b96a AUX elasticsearch.init.5 2050 BLAKE2B 51908266d476c0fe21ceeb01e4fb9aede5ef70944025a26dbbaea582253e32442a938e39842371397b15c70ecfc9ae4abc8f549f75c3fdf55e1d09e16c25f871 SHA512 127f050a322ba2fd1ca92352ccfc9e3abf5e768b0c1b6e6fbb73633f4aa8fb3dbc8c9118428ed56070e91e2141edda2cd488185a272f0d0022e88ca32172cd7f +AUX elasticsearch.init.6 2102 BLAKE2B e49581ac65b20feb24711674a2f5f46bc67d65cd8e5128f1d0868a84db36b0067b13ae39ea3f57d0b4c8ebfd91fb3d769088c29dacf8436beb66fe98cea0b03e SHA512 52116a49c9bce9ebe57316f96f3b6eff3a6bd544b930845d5fb9b74fc5f40535a0e50d71f8c7e602fbe8935ec35692b763a5255ad43afac5f7ac8ac00ba2bd30 AUX elasticsearch.service 1718 BLAKE2B 1d3df50f9b521a897f6f57c411265ce3d5da849c23a6d5274959739531ec1f1373f59adb9d0ac94318eefbe90cf10218b67aa47530bdd162ed306354fb9cf2db SHA512 98530c01f41a2d98254033a1a292075abc6086e0608062dfbe28385e4f57da390a9c43521bfce72193c2b710e58e590f08f514257b8150140dbb9ade40ef5470 AUX elasticsearch.service.3 1527 BLAKE2B 7f7bee9019de2814cdce1e4a66932a0a2a915cddce2d5d2bfde2263bf088001ba1dff9bbbc8eaafb4e1d9012176fbeb4964dcd6f25f6e49935bdda90cec52f6d SHA512 adcc3147ce8d52f64fa21e7cb377ba88d4ea32254eaea03c68d45296bac46d7ff084b93469ca9dbabe013bf8bd183a96a219117b68fb91648b595206b60cebbc AUX elasticsearch.service.conf 235 BLAKE2B 23ada111be21dff12323edbe981883cb1ed275b6c7a9f55e77fdcec1919d374818683403a2a7a7c2c2839db2b8afcd66f7667d5080ecb52cade853a400f972a6 SHA512 b300dbc1b3c341ebbcac68385c651133427f342dc0351501b47730b392cc176b7b8dc53877affc6ab384d2834d246a3d0c63b6015dddf2c90d4bcf41cee9968c AUX elasticsearch.sysctl.d 24 BLAKE2B 4012fbdbc98a8b28df11aed33cb82c113790c44721eae1d69e19c595bfbf329618b9cb67be9528f1994c546233cffd31b20eee39edc142bc86f7a7cf5e08903e SHA512 9f3d8238edff6704bea06b6535ee8915f4a3c9bdc8389d9d4943bcfa49161b61f9a1ca49dbcc415580438f4396fbc3d58eef301554f9426287606a755ada715c AUX elasticsearch.tmpfiles.d 56 BLAKE2B 0c28c612fadfdd86321df797527399fa5073a7350de95ec2b32dfbe51cbf52fe5dcf68ebd4e3fba6cccba1cf252a16dee3b701c4c6692121745c41665cf3c972 SHA512 5cc722abcaae68afffde96e38b2c9572faf898178d3c291c945fe49fbf977e319322b99fb6fb5bf49cfb04e86f071dde0db621849288f712a56571b13af9a11a -DIST elasticsearch-5.6.15.tar.gz 33887584 BLAKE2B f0e36842bacb73a552400a8874b0eea6e01ee9b09cd4094edae227f3cab0558ef422b3616786ea5cf169a3b6d684fc784df85aaf1a5397e2fb9eeed16b657740 SHA512 7509dc7a9be63c758448c35ec2d87923b4a3a596c7ff2f92863021a9e3604ec9171ac5180014edb70b600dc3029f681212e9be703818c04b6d3938c289eea4a4 +DIST elasticsearch-5.6.16.tar.gz 33894983 BLAKE2B f96e78f1f28d8106948c91a0d31ea3d41b538fb0fd8534e2f52be651cf22986c76eae67c58c8ef10fef218d1646b1b4b5aa0a3625520e62e482063420775e92e SHA512 cc831e50ce311366484c47cf9fead9bd6562035132e6fd29508e78776dd71846c713d8d1e7a0a99338df46cad124149fb5d767e0ae0bbbed0b50153e234f2631 DIST elasticsearch-6.6.1.tar.gz 114126547 BLAKE2B b335b224af0c241cbdf83f81feec103274d9cdd9ee7f9c3c5a788cbfc4d7a24b3a345aa14853e378796f733c151f7f21b5b081b2071b56f40f0f068ef6b07939 SHA512 3f8619ae6a10a34c57d8bc0c2ba3851b79a494ea05a3d02119a6e12d2c6cb6a651e73b43adfd674b7fb16664b709b643d4be9ba0785dbcc6d7a7cc41da7b669f +DIST elasticsearch-6.7.1.tar.gz 148542786 BLAKE2B 4a9acd16788e6d84acfac09ee2434135fdef85d0bec5baa873f7bfd7cb6d340932d6b67b13a8f5095dc04d1981a029ab7f87d90c2b4a796eb198e9b8c531db9d SHA512 dcd3a6beae8b4a2322144058871074f193974565341da5703ec991947c2749ee67e87202e937148f653594f5fd33fdbb8adc891a200d4e03d8363575992eb9ec +DIST elasticsearch-7.0.0-no-jdk-linux-x86_64.tar.gz 149074223 BLAKE2B 3c210b81de8882f99be45adc811c3867acb276978d3c788db5cb00ec0eacd0f096933849dfa066160ca2ec05e3fa2962329b200614db9927e4424602da53508f SHA512 b499aeab6a3f883547974b36221fd808a9da70ae0622856582287dcf729c3a2acfb1faef2727b17be97f64d8bb56ac5cdbae6d63f2a146027153f170ae6d91fc DIST elasticsearch-oss-6.6.1.tar.gz 34492424 BLAKE2B 9a63aeb86ec3bebbe685804b262316726cb93b42693f9ba8937cac65c7ec186f0bb470893568234a0b7cc8b58f0c91d2af94eb16c3d016e7533231eba32fdbb0 SHA512 0e536ff760673dd740f790f1b0c01d984bf989a4a9ad3c4fe998de4f824330ce0d5ea18f04421a8648af719aabd25a4393f90182079186e48cef539b5621914c -EBUILD elasticsearch-5.6.15.ebuild 1686 BLAKE2B e5a66c3eb054f849bbfbc90abcdd8fdb8b5ba8ea69ddbcc8f2d9964ad70864cdd094c29480728c8d5b830184289fcb2a8c9efcefcfb6c026d7a5dfdd2f211497 SHA512 4e6f1a2478e0cfe515add2c63f6f906fbc62822fe4b79b65146e9589dba6bbfd4540c1bcb623137dcb8417c6ee36d4518621c3dac683eab02a57f0cb01a7720b +DIST elasticsearch-oss-6.7.1.tar.gz 68421385 BLAKE2B cf14f3babfc5dbe9de4c9e47c15b797ab7c73236936257043c435751a0d86348e34ee73d2a6785a9e1391edc1e00f9a56f922c368ef72a5d349175ee4735d43b SHA512 4865ebd3403593048b3f922769d6d09eb1d53a42cf206cdcba7c30e330b39d9bd57f9f0979a23fcf0ca7636d84ce85de210fdf655447fab7ecebb35bffdd3323 +DIST elasticsearch-oss-7.0.0-no-jdk-linux-x86_64.tar.gz 68788144 BLAKE2B 29206b277dc9997b155b54217f485c314a7efa35777bcb81908ce900e134e62d7ef14629cfeebcd3ebb724b76fe5380085ae6b50df46bdfddf5f657a0d2da3eb SHA512 ec9381d9310145b80fb2b8cdd7b7953ea7b2b45a66bf8435d8a982aed0eeb59f734f3936b4b40ec4530e106878d25c2f63d4ea7a734b12f1c8d86b39f7894963 +EBUILD elasticsearch-5.6.16.ebuild 1686 BLAKE2B 45ba9183eacdc9e25a9c640ea98a6c4bcaaa6894ac1fcf87874fa70205677a4a4991fe81b52934ab9b0e6243d967b653ded4c27ab157491eb6671e08855c3b31 SHA512 9198ef6590d77ca6817e504ee846a80aa2b2a0a440f57786fa63f3b2332480dc630207474c0e5d859dbb2c6a035f9db3a2f3a8ff965defba2fcb4c76ab4ca95d EBUILD elasticsearch-6.6.1.ebuild 2579 BLAKE2B 35aa006966938554dcea8f77202a355adde841a5faec231fda4615fb79f5968c89ea2519cd7f737071c37fab74b848e297e56951af23cc034dfc7839f4b65796 SHA512 fe8a12e1efb2b096b4ed7854d9da952af85797f8020bf843a01732040b07fefcf616fe50574f9faab2b89fa103a542b2cc83f44f9ebc42715dc81fe9c8a9c668 +EBUILD elasticsearch-6.7.1.ebuild 2579 BLAKE2B 35aa006966938554dcea8f77202a355adde841a5faec231fda4615fb79f5968c89ea2519cd7f737071c37fab74b848e297e56951af23cc034dfc7839f4b65796 SHA512 fe8a12e1efb2b096b4ed7854d9da952af85797f8020bf843a01732040b07fefcf616fe50574f9faab2b89fa103a542b2cc83f44f9ebc42715dc81fe9c8a9c668 +EBUILD elasticsearch-7.0.0.ebuild 2599 BLAKE2B 4fdab7d1b5e22f1d803c06642392a05adfa8c201dcd83964c23e3a10acea796cba12fc5aaac7aad3078ffd01c0f6c49afa967ab3485ed10731d5f304d99d8f25 SHA512 6ff2036c226f3b74cbf8c487dd8fdf8cf52e870bda3cbf43da5565a43cece9770a41ef72f018026a66f769b05bc4d18e9def22a9e8c091ea9fc0a045ffa84460 MISC metadata.xml 567 BLAKE2B 3123e01d77b67569afb2bb4908b38c702ebe1d308ea236b8ebba11709bc421af27ec29d72398a3af0aaefb39a2a2f34e27bffbbd1b3306dbc299e49bfd48cd35 SHA512 74669ea5437ad23c604c82a734973d58a31d78f0f4a2b7e2db655d884bf017d32ea25e451517601b35d406789e661ed2e173752bc232a03c3564e971c5a83a0c diff --git a/app-misc/elasticsearch/elasticsearch-5.6.15.ebuild b/app-misc/elasticsearch/elasticsearch-5.6.15.ebuild deleted file mode 100644 index f5399ac194fb..000000000000 --- a/app-misc/elasticsearch/elasticsearch-5.6.15.ebuild +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit systemd user - -DESCRIPTION="Open Source, Distributed, RESTful, Search Engine" -HOMEPAGE="https://www.elastic.co/products/elasticsearch" -SRC_URI="https://artifacts.elastic.co/downloads/${PN}/${P}.tar.gz" -LICENSE="Apache-2.0 BSD-2 LGPL-3 MIT public-domain" -SLOT="0" -KEYWORDS="~amd64" - -RDEPEND="virtual/jre:1.8" - -pkg_setup() { - enewgroup ${PN} - enewuser ${PN} -1 /bin/bash /usr/share/${PN} ${PN} -} - -src_prepare() { - default - - rm -v bin/*.{bat,exe} LICENSE.txt || die -} - -src_install() { - keepdir /etc/${PN} - keepdir /etc/${PN}/scripts - - insinto /etc/${PN} - doins -r config/. - rm -rv config || die - - insinto /usr/share/${PN} - doins -r . - - exeinto /usr/share/${PN}/bin - doexe "${FILESDIR}/elasticsearch-systemd-pre-exec" - - chmod +x "${ED}"/usr/share/${PN}/bin/* || die - - keepdir /var/{lib,log}/${PN} - fowners ${PN}:${PN} /var/{lib,log}/${PN} - fperms 0750 /var/{lib,log}/${PN} - dodir /usr/share/${PN}/plugins - - insinto /etc/sysctl.d - newins "${FILESDIR}/${PN}.sysctl.d" ${PN}.conf - - newconfd "${FILESDIR}/${PN}.conf.2" ${PN} - newinitd "${FILESDIR}/${PN}.init.2" ${PN} - - systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles.d" ${PN}.conf - systemd_newunit "${FILESDIR}"/${PN}.service ${PN}.service -} - -pkg_postinst() { - elog - elog "You may create multiple instances of ${PN} by" - elog "symlinking the init script:" - elog "ln -sf /etc/init.d/${PN} /etc/init.d/${PN}.instance" - elog - elog "Please make sure you put elasticsearch.yml, log4j2.properties and scripts" - elog "from /etc/elasticsearch into the configuration directory of the instance:" - elog "/etc/${PN}/instance" - elog -} diff --git a/app-misc/elasticsearch/elasticsearch-5.6.16.ebuild b/app-misc/elasticsearch/elasticsearch-5.6.16.ebuild new file mode 100644 index 000000000000..0fa64b4d2693 --- /dev/null +++ b/app-misc/elasticsearch/elasticsearch-5.6.16.ebuild @@ -0,0 +1,69 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit systemd user + +DESCRIPTION="Open Source, Distributed, RESTful, Search Engine" +HOMEPAGE="https://www.elastic.co/products/elasticsearch" +SRC_URI="https://artifacts.elastic.co/downloads/${PN}/${P}.tar.gz" +LICENSE="Apache-2.0 BSD-2 LGPL-3 MIT public-domain" +SLOT="0" +KEYWORDS="~amd64" + +RDEPEND="virtual/jre:1.8" + +pkg_setup() { + enewgroup ${PN} + enewuser ${PN} -1 /bin/bash /usr/share/${PN} ${PN} +} + +src_prepare() { + default + + rm -v bin/*.{bat,exe} LICENSE.txt || die +} + +src_install() { + keepdir /etc/${PN} + keepdir /etc/${PN}/scripts + + insinto /etc/${PN} + doins -r config/. + rm -rv config || die + + insinto /usr/share/${PN} + doins -r . + + exeinto /usr/share/${PN}/bin + doexe "${FILESDIR}/elasticsearch-systemd-pre-exec" + + chmod +x "${ED}"/usr/share/${PN}/bin/* || die + + keepdir /var/{lib,log}/${PN} + fowners ${PN}:${PN} /var/{lib,log}/${PN} + fperms 0750 /var/{lib,log}/${PN} + dodir /usr/share/${PN}/plugins + + insinto /etc/sysctl.d + newins "${FILESDIR}/${PN}.sysctl.d" ${PN}.conf + + newconfd "${FILESDIR}/${PN}.conf.2" ${PN} + newinitd "${FILESDIR}/${PN}.init.2" ${PN} + + systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles.d" ${PN}.conf + systemd_newunit "${FILESDIR}"/${PN}.service ${PN}.service +} + +pkg_postinst() { + elog + elog "You may create multiple instances of ${PN} by" + elog "symlinking the init script:" + elog "ln -sf /etc/init.d/${PN} /etc/init.d/${PN}.instance" + elog + elog "Please make sure you put elasticsearch.yml, log4j2.properties and scripts" + elog "from /etc/elasticsearch into the configuration directory of the instance:" + elog "/etc/${PN}/instance" + elog +} diff --git a/app-misc/elasticsearch/elasticsearch-6.7.1.ebuild b/app-misc/elasticsearch/elasticsearch-6.7.1.ebuild new file mode 100644 index 000000000000..80521b9e40fd --- /dev/null +++ b/app-misc/elasticsearch/elasticsearch-6.7.1.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit systemd user + +DESCRIPTION="Open Source, Distributed, RESTful, Search Engine" +HOMEPAGE="https://www.elastic.co/products/elasticsearch" +SRC_URI="x-pack? ( https://artifacts.elastic.co/downloads/${PN}/${P}.tar.gz ) + !x-pack? ( https://artifacts.elastic.co/downloads/${PN}/${PN}-oss-${PV}.tar.gz )" +LICENSE="Apache-2.0 BSD-2 LGPL-3 MIT public-domain x-pack? ( Elastic )" +SLOT="0" +KEYWORDS="~amd64" +IUSE="x-pack" + +RDEPEND="virtual/jre:1.8" + +QA_PRESTRIPPED="usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/\(bin\|lib\)/.*" + +pkg_setup() { + enewgroup ${PN} + enewuser ${PN} -1 /bin/bash /usr/share/${PN} ${PN} +} + +src_prepare() { + default + + rm bin/*.{bat,exe} LICENSE.txt NOTICE.txt || die + rmdir logs || die + + if use x-pack; then + rm bin/x-pack/*.bat || die + rm -r modules/x-pack-ml/platform/{darwin,windows}-x86_64 || die + fi +} + +src_install() { + keepdir /etc/${PN} + keepdir /etc/${PN}/scripts + + insinto /etc/${PN} + doins -r config/. + rm -r config || die + + fowners root:${PN} /etc/${PN} + fperms 2750 /etc/${PN} + + insinto /usr/share/${PN} + doins -r . + + exeinto /usr/share/${PN}/bin + doexe "${FILESDIR}/elasticsearch-systemd-pre-exec" + + chmod +x "${ED}"/usr/share/${PN}/bin/* || die + + if use x-pack; then + chmod +x "${ED}"/usr/share/${PN}/modules/x-pack-ml/platform/linux-x86_64/bin/* || die + fi + + keepdir /var/{lib,log}/${PN} + fowners ${PN}:${PN} /var/{lib,log}/${PN} + fperms 0750 /var/{lib,log}/${PN} + dodir /usr/share/${PN}/plugins + + insinto /etc/sysctl.d + newins "${FILESDIR}/${PN}.sysctl.d" ${PN}.conf + + newconfd "${FILESDIR}/${PN}.conf.3" ${PN} + newinitd "${FILESDIR}/${PN}.init.5" ${PN} + + systemd_install_serviced "${FILESDIR}/${PN}.service.conf" + systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles.d" ${PN}.conf + systemd_newunit "${FILESDIR}"/${PN}.service.3 ${PN}.service +} + +pkg_postinst() { + elog + elog "You may create multiple instances of ${PN} by" + elog "symlinking the init script:" + elog "ln -sf /etc/init.d/${PN} /etc/init.d/${PN}.instance" + elog + elog "Please make sure you put elasticsearch.yml, log4j2.properties and scripts" + elog "from /etc/${PN} into the configuration directory of the instance:" + elog "/etc/${PN}/instance" + elog + ewarn "Please make sure you have proper permissions on /etc/${PN}" + ewarn "prior to keystore generation or you may experience startup fails." + ewarn "chown root:${PN} /etc/${PN} && chmod 2750 /etc/${PN}" + ewarn "chown root:${PN} /etc/${PN}/${PN}.keystore && chmod 0660 /etc/${PN}/${PN}.keystore" +} diff --git a/app-misc/elasticsearch/elasticsearch-7.0.0.ebuild b/app-misc/elasticsearch/elasticsearch-7.0.0.ebuild new file mode 100644 index 000000000000..1d757551fca1 --- /dev/null +++ b/app-misc/elasticsearch/elasticsearch-7.0.0.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit systemd user + +DESCRIPTION="Open Source, Distributed, RESTful, Search Engine" +HOMEPAGE="https://www.elastic.co/products/elasticsearch" +SRC_URI="x-pack? ( https://artifacts.elastic.co/downloads/${PN}/${P}-no-jdk-linux-x86_64.tar.gz ) + !x-pack? ( https://artifacts.elastic.co/downloads/${PN}/${PN}-oss-${PV}-no-jdk-linux-x86_64.tar.gz )" +LICENSE="Apache-2.0 BSD-2 LGPL-3 MIT public-domain x-pack? ( Elastic )" +SLOT="0" +KEYWORDS="~amd64" +IUSE="x-pack" + +RDEPEND="virtual/jre" + +QA_PRESTRIPPED="usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/\(bin\|lib\)/.*" + +pkg_setup() { + enewgroup ${PN} + enewuser ${PN} -1 /bin/bash /usr/share/${PN} ${PN} +} + +src_prepare() { + default + + rm LICENSE.txt NOTICE.txt || die + rmdir logs || die + + if use x-pack; then + rm bin/x-pack/*.bat || die + rm -r modules/x-pack-ml/platform/{darwin,windows}-x86_64 || die + fi +} + +src_install() { + keepdir /etc/${PN} + keepdir /etc/${PN}/scripts + + insinto /etc/${PN} + doins -r config/. + rm -r config || die + + fowners root:${PN} /etc/${PN} + fperms 2750 /etc/${PN} + + insinto /usr/share/${PN} + doins -r . + + exeinto /usr/share/${PN}/bin + doexe "${FILESDIR}/elasticsearch-systemd-pre-exec" + + chmod +x "${ED}"/usr/share/${PN}/bin/* || die + + if use x-pack; then + chmod +x "${ED}"/usr/share/${PN}/modules/x-pack-ml/platform/linux-x86_64/bin/* || die + fi + + keepdir /var/{lib,log}/${PN} + fowners ${PN}:${PN} /var/{lib,log}/${PN} + fperms 0750 /var/{lib,log}/${PN} + dodir /usr/share/${PN}/plugins + + insinto /etc/sysctl.d + newins "${FILESDIR}/${PN}.sysctl.d" ${PN}.conf + + newconfd "${FILESDIR}/${PN}.conf.3" ${PN} + newinitd "${FILESDIR}/${PN}.init.6" ${PN} + + systemd_install_serviced "${FILESDIR}/${PN}.service.conf" + systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles.d" ${PN}.conf + systemd_newunit "${FILESDIR}"/${PN}.service.3 ${PN}.service +} + +pkg_postinst() { + elog + elog "You may create multiple instances of ${PN} by" + elog "symlinking the init script:" + elog "ln -sf /etc/init.d/${PN} /etc/init.d/${PN}.instance" + elog + elog "Please make sure you put elasticsearch.yml, log4j2.properties and scripts" + elog "from /etc/${PN} into the configuration directory of the instance:" + elog "/etc/${PN}/instance" + elog + ewarn "Please make sure you have proper permissions on /etc/${PN}" + ewarn "prior to keystore generation or you may experience startup fails." + ewarn "chown root:${PN} /etc/${PN} && chmod 2750 /etc/${PN}" + ewarn "chown root:${PN} /etc/${PN}/${PN}.keystore && chmod 0660 /etc/${PN}/${PN}.keystore" +} diff --git a/app-misc/elasticsearch/files/elasticsearch.init.6 b/app-misc/elasticsearch/files/elasticsearch.init.6 new file mode 100644 index 000000000000..046941d407e5 --- /dev/null +++ b/app-misc/elasticsearch/files/elasticsearch.init.6 @@ -0,0 +1,69 @@ +#!/sbin/openrc-run + +name="Elasticsearch" +description="Elasticsearch Server" + +ES_INSTANCE=${RC_SVCNAME#*.} + +if [ -n "${ES_INSTANCE}" ] && [ ${RC_SVCNAME} != "elasticsearch" ]; then + ES_BASE_PATH="/var/lib/elasticsearch/${ES_INSTANCE}" + CONF_DIR="/etc/elasticsearch/${ES_INSTANCE}" + DEFAULT_LOG_DIR="/var/log/elasticsearch/${ES_INSTANCE}" +else + ES_BASE_PATH="/var/lib/elasticsearch/_default" + CONF_DIR="/etc/elasticsearch" + DEFAULT_LOG_DIR="/var/log/elasticsearch/_default" +fi + +ES_HOME=${ES_HOME:="/usr/share/elasticsearch"} +ES_USER=${ES_USER:="elasticsearch"} +ES_GROUP=${ES_GROUP:="elasticsearch"} +ES_STARTUP_SLEEP_TIME=${ES_STARTUP_TIME:=5} +JAVA_HOME=${JAVA_HOME:=$(java-config -g JAVA_HOME)} +MAX_OPEN_FILES=${MAX_OPEN_FILES:=65536} +MAX_MAP_COUNT=${MAX_MAP_COUNT:=262144} + +DATA_DIR=${DATA_DIR:="${ES_BASE_PATH}/data"} +LOG_DIR=${LOG_DIR:="${DEFAULT_LOG_DIR}"} + +if [ -f "${CONF_DIR}/elasticsearch.in.sh" ]; then + ES_INCLUDE="${CONF_DIR}/elasticsearch.in.sh" +fi + +export ES_INCLUDE +export JAVA_HOME +export JAVA_OPTS +export ES_JVM_OPTIONS +export ES_JAVA_OPTS +export ES_STARTUP_SLEEP_TIME +export ES_PATH_CONF="${CONF_DIR}" + +pidfile="/run/elasticsearch/${RC_SVCNAME}.pid" + +command="/usr/share/elasticsearch/bin/elasticsearch" +command_args="-Epath.logs=${LOG_DIR} -Epath.data=${DATA_DIR}" +command_args_background="--daemonize --pidfile=${pidfile}" +command_user="${ES_USER}:${ES_GROUP}" +required_files="${CONF_DIR}/elasticsearch.yml" +retry="TERM/30/KILL/30" + +depend() { + use net +} + +start_pre() { + if [ -n "${MAX_MAP_COUNT}" -a -f /proc/sys/vm/max_map_count ]; then + sysctl -q -w vm.max_map_count=${MAX_MAP_COUNT} + fi + + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "/var/lib/elasticsearch" + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "/var/log/elasticsearch" + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "/run/elasticsearch" + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "${ES_BASE_PATH}" + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "${LOG_DIR}" + + # fails to start without keystore + if [ ! -f "${CONF_DIR}/elasticsearch.keystore" ]; then + "${ES_HOME}/bin/elasticsearch-keystore" create + fi +} -- cgit v1.2.3