From 357aef69787bd97b06456355da7010c0474acdc5 Mon Sep 17 00:00:00 2001 From: Aaron Levy Date: Wed, 12 Sep 2018 18:37:45 -0700 Subject: [PATCH 1/5] Adding /etc/rc.d/init.d/functions to the init script when present to improve integration with systemd on systemd-based distros. See https://github.com/elastic/kibana/issues/22255 --- .../os_packages/service_templates/sysv/etc/init.d/kibana | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana b/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana index fc1b797fe8ed2..3f1c4954ba399 100755 --- a/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana +++ b/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana @@ -15,6 +15,13 @@ # Description: Kibana ### END INIT INFO +# +# Source function library if present. +# +if [ -f /etc/rc.d/init.d/functions ]; then + . /etc/rc.d/init.d/functions +fi + name=kibana program=/usr/share/kibana/bin/kibana args=-c\\\ /etc/kibana/kibana.yml From 6e971de0e7b25953a5607d343ccd7fe8aa29846b Mon Sep 17 00:00:00 2001 From: Aaron Levy Date: Wed, 3 Oct 2018 00:47:21 -0400 Subject: [PATCH 2/5] Adding SysV Init Functions for Debian and SUSE distros --- .../service_templates/sysv/etc/init.d/kibana | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana b/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana index 3f1c4954ba399..5fd2c4561b341 100755 --- a/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana +++ b/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana @@ -16,10 +16,20 @@ ### END INIT INFO # -# Source function library if present. +# Source function libraries if present. # +# Red Hat if [ -f /etc/rc.d/init.d/functions ]; then . /etc/rc.d/init.d/functions + +# Debian +elif [ -f /lib/lsb/init-functions ]; then + . /lib/lsb/init-functions + +# SUSE +elif [ -f /etc/rc.status ]; then + . /etc/rc.status + rc_reset fi name=kibana From 521841f4198b85b71feb1ce4346692436e038451 Mon Sep 17 00:00:00 2001 From: Aaron Levy Date: Wed, 12 Sep 2018 18:37:45 -0700 Subject: [PATCH 3/5] Adding /etc/rc.d/init.d/functions to the init script when present to improve integration with systemd on systemd-based distros. See https://github.com/elastic/kibana/issues/22255 --- .../os_packages/service_templates/sysv/etc/init.d/kibana | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana b/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana index fc1b797fe8ed2..3f1c4954ba399 100755 --- a/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana +++ b/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana @@ -15,6 +15,13 @@ # Description: Kibana ### END INIT INFO +# +# Source function library if present. +# +if [ -f /etc/rc.d/init.d/functions ]; then + . /etc/rc.d/init.d/functions +fi + name=kibana program=/usr/share/kibana/bin/kibana args=-c\\\ /etc/kibana/kibana.yml From 91c2e3f9612837b981737c245fd305f0ddf073e1 Mon Sep 17 00:00:00 2001 From: Aaron Levy Date: Wed, 3 Oct 2018 00:47:21 -0400 Subject: [PATCH 4/5] Adding SysV Init Functions for Debian and SUSE distros --- .../service_templates/sysv/etc/init.d/kibana | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana b/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana index 3f1c4954ba399..5fd2c4561b341 100755 --- a/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana +++ b/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana @@ -16,10 +16,20 @@ ### END INIT INFO # -# Source function library if present. +# Source function libraries if present. # +# Red Hat if [ -f /etc/rc.d/init.d/functions ]; then . /etc/rc.d/init.d/functions + +# Debian +elif [ -f /lib/lsb/init-functions ]; then + . /lib/lsb/init-functions + +# SUSE +elif [ -f /etc/rc.status ]; then + . /etc/rc.status + rc_reset fi name=kibana From c4ab81f3a367cb95fb7d77f1d60c5c29b84cc030 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 14 Aug 2020 20:45:31 +0100 Subject: [PATCH 5/5] docs(NA): include a comment to explain the change --- .../tasks/os_packages/service_templates/sysv/etc/init.d/kibana | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana b/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana index f802e7e1c265b..c13676ef031b0 100755 --- a/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana +++ b/src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/kibana @@ -17,6 +17,7 @@ # # Source function libraries if present. +# (It improves integration with systemd) # # Red Hat if [ -f /etc/rc.d/init.d/functions ]; then