diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2019-01-23 14:56:52 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2019-01-23 16:15:07 +0100 |
commit | 7c4e67edf985e3386d882973bd78662a9296a750 (patch) | |
tree | 3352bdd73399679a1a098d26605b8892f90b8a72 | |
parent | 46bd6e6b18d0e5b919c717db21bce3243a8306b3 (diff) | |
download | alpine_aports-7c4e67edf985e3386d882973bd78662a9296a750.tar.bz2 alpine_aports-7c4e67edf985e3386d882973bd78662a9296a750.tar.xz alpine_aports-7c4e67edf985e3386d882973bd78662a9296a750.zip |
community/elasticsearch: fix and improve init script
* SVCNAME is deprecated for a very long time, RC_SVCNAME should be used
* nice 0 is the default value, not needed to define
* error.log was previously owned by root instead of the ES user, so we need to fix it
-rw-r--r-- | community/elasticsearch/APKBUILD | 6 | ||||
-rw-r--r-- | community/elasticsearch/elasticsearch.initd | 13 | ||||
-rw-r--r-- | community/elasticsearch/elasticsearch.post-upgrade | 11 |
3 files changed, 21 insertions, 9 deletions
diff --git a/community/elasticsearch/APKBUILD b/community/elasticsearch/APKBUILD index f01eb17446..02415ba9ff 100644 --- a/community/elasticsearch/APKBUILD +++ b/community/elasticsearch/APKBUILD | |||
@@ -2,14 +2,14 @@ | |||
2 | # Maintainer: Jakub Jirutka <jakub@jirutka.cz> | 2 | # Maintainer: Jakub Jirutka <jakub@jirutka.cz> |
3 | pkgname=elasticsearch | 3 | pkgname=elasticsearch |
4 | pkgver=6.4.1 | 4 | pkgver=6.4.1 |
5 | pkgrel=0 | 5 | pkgrel=1 |
6 | pkgdesc="Open Source, Distributed, RESTful Search Engine" | 6 | pkgdesc="Open Source, Distributed, RESTful Search Engine" |
7 | url="https://www.elastic.co/products/elasticsearch" | 7 | url="https://www.elastic.co/products/elasticsearch" |
8 | arch="x86 x86_64 ppc64le" | 8 | arch="x86 x86_64 ppc64le" |
9 | license="Apache-2.0" | 9 | license="Apache-2.0" |
10 | depends="java-jna-native>=4.1 openjdk8-jre bash" | 10 | depends="java-jna-native>=4.1 openjdk8-jre bash" |
11 | makedepends="" | 11 | makedepends="" |
12 | install="$pkgname.pre-install" | 12 | install="$pkgname.pre-install $pkgname.post-upgrade" |
13 | subpackages="$pkgname-doc $pkgname-x-pack:_x_pack" | 13 | subpackages="$pkgname-doc $pkgname-x-pack:_x_pack" |
14 | options="!check" # no test suite | 14 | options="!check" # no test suite |
15 | pkgusers="elastico" | 15 | pkgusers="elastico" |
@@ -115,7 +115,7 @@ _x_pack() { | |||
115 | } | 115 | } |
116 | 116 | ||
117 | sha512sums="a023a6db5554dee6f10718dfa297aa06a735c7857542c2db80fa5c2b86ff4bf405bb8167578c5b60741ad05ed96a64b54bc71d128a0ff955468b0449588b053c elasticsearch-6.4.1.tar.gz | 117 | sha512sums="a023a6db5554dee6f10718dfa297aa06a735c7857542c2db80fa5c2b86ff4bf405bb8167578c5b60741ad05ed96a64b54bc71d128a0ff955468b0449588b053c elasticsearch-6.4.1.tar.gz |
118 | c16b8c724dbcfd938b50d75a1676a8428f8cd10df4c2e60f719a1c8bd1f229756fabcb351882426dd44e14944a28c4fc0bd341bcfe7fea89ccca5e4a23e74efc elasticsearch.initd | 118 | 2477cb748ea08de0b0a4c931e68d875b1a363c029820dcc2144f0da9a5adb3ad2c17d8f2f7cc7bea85a16b61951a782e6eb48e3d5890505638e3245ec04e21d7 elasticsearch.initd |
119 | 2ab1baf1b5c8782f3f371ba221aadd3e841abc62175f0b1ddcfc68d711e2370465124e076f8cc2e549c25a1da9db8c90172b2f410bd6bbe4153f0e831620b6ba elasticsearch.confd | 119 | 2ab1baf1b5c8782f3f371ba221aadd3e841abc62175f0b1ddcfc68d711e2370465124e076f8cc2e549c25a1da9db8c90172b2f410bd6bbe4153f0e831620b6ba elasticsearch.confd |
120 | 6de81485cdc059afef58382862e4155482463fde0b604aaa8dbe904c778b841467c4a383a5e54acd09e3436f1fb7be9923e001fb77bd3d7894e113a5e0f4036b README.alpine | 120 | 6de81485cdc059afef58382862e4155482463fde0b604aaa8dbe904c778b841467c4a383a5e54acd09e3436f1fb7be9923e001fb77bd3d7894e113a5e0f4036b README.alpine |
121 | 1f9d13bbc42c04c523ef4e9ce734f919ec3d79748d78f288ed3dd725cf7c74e83d66d8b48fbc782b27b1a760096a647cb33773578071710542b19fda18ea0b84 busybox-mktemp.patch" | 121 | 1f9d13bbc42c04c523ef4e9ce734f919ec3d79748d78f288ed3dd725cf7c74e83d66d8b48fbc782b27b1a760096a647cb33773578071710542b19fda18ea0b84 busybox-mktemp.patch" |
diff --git a/community/elasticsearch/elasticsearch.initd b/community/elasticsearch/elasticsearch.initd index f992b0b8a6..eefaceb7a7 100644 --- a/community/elasticsearch/elasticsearch.initd +++ b/community/elasticsearch/elasticsearch.initd | |||
@@ -3,7 +3,7 @@ supervisor=supervise-daemon | |||
3 | 3 | ||
4 | description="A Distributed RESTful Search Engine." | 4 | description="A Distributed RESTful Search Engine." |
5 | 5 | ||
6 | instance_name="${SVCNAME#elasticsearch.}" | 6 | instance_name="${RC_SVCNAME#elasticsearch.}" |
7 | instance_name="${instance_name/elasticsearch/_default}" | 7 | instance_name="${instance_name/elasticsearch/_default}" |
8 | 8 | ||
9 | name="Elasticsearch" | 9 | name="Elasticsearch" |
@@ -20,6 +20,7 @@ name="Elasticsearch" | |||
20 | : ${default_script_dir:="$conf_dir/scripts"} | 20 | : ${default_script_dir:="$conf_dir/scripts"} |
21 | : ${default_work_dir:="/var/tmp/elasticsearch/$instance_name"} | 21 | : ${default_work_dir:="/var/tmp/elasticsearch/$instance_name"} |
22 | : ${create_logs_dir:="yes"} | 22 | : ${create_logs_dir:="yes"} |
23 | : ${error_log:="$default_logs_dir/error.log"} | ||
23 | 24 | ||
24 | elastic_opts=" | 25 | elastic_opts=" |
25 | -Epath.data=$default_data_dir | 26 | -Epath.data=$default_data_dir |
@@ -41,11 +42,11 @@ export ES_JAVA_OPTS="$java_opts" | |||
41 | export ES_JVM_OPTIONS="$conf_dir/jvm.options" | 42 | export ES_JVM_OPTIONS="$conf_dir/jvm.options" |
42 | export ES_PATH_CONF="$conf_dir" | 43 | export ES_PATH_CONF="$conf_dir" |
43 | 44 | ||
44 | nice="0" | 45 | command="/usr/share/java/elasticsearch/bin/elasticsearch" |
45 | pidfile="/run/$SVCNAME.sd.pid" | 46 | command_args="$elastic_opts" |
46 | supervise_daemon_args="-u $user -g $group -p $pidfile -N $nice" | 47 | command_user="$user:$group" |
47 | command=/usr/share/java/elasticsearch/bin/elasticsearch | 48 | command_background="yes" |
48 | command_args="$elastic_opts 1>/dev/null 2>>$default_logs_dir/error.log" | 49 | pidfile="/run/$RC_SVCNAME.sd.pid" |
49 | 50 | ||
50 | depends() { | 51 | depends() { |
51 | use net | 52 | use net |
diff --git a/community/elasticsearch/elasticsearch.post-upgrade b/community/elasticsearch/elasticsearch.post-upgrade new file mode 100644 index 0000000000..af936afd41 --- /dev/null +++ b/community/elasticsearch/elasticsearch.post-upgrade | |||
@@ -0,0 +1,11 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ver_new="$1" | ||
4 | ver_old="$2" | ||
5 | |||
6 | if [ "$(apk version -t "$ver_old" "6.4.1-r1")" = "<" ]; then | ||
7 | chown elastico:elastico /var/log/elasticsearch/error.log 2>/dev/null | ||
8 | chown elastico:elastico /var/log/elasticsearch/*/error.log 2>/dev/null | ||
9 | fi | ||
10 | |||
11 | exit 0 | ||