From f97ac4dde846ac91e97da8461e1340a585a7b41a Mon Sep 17 00:00:00 2001 From: Aaron Levy Date: Fri, 14 Aug 2020 17:27:07 -0700 Subject: [PATCH] =?UTF-8?q?Adding=20/etc/rc.d/init.d/functions=20to=20the?= =?UTF-8?q?=20init=20script=20when=20present=20to=20=E2=80=A6=20(#22985)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 * Adding SysV Init Functions for Debian and SUSE distros * 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 * Adding SysV Init Functions for Debian and SUSE distros * docs(NA): include a comment to explain the change Co-authored-by: Elastic Machine Co-authored-by: Tiago Costa --- .../service_templates/sysv/etc/init.d/kibana | 18 ++++++++++++++++++ 1 file changed, 18 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 449fc4e75fce8..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 @@ -15,6 +15,24 @@ # Description: Kibana ### END INIT INFO +# +# Source function libraries if present. +# (It improves integration with systemd) +# +# 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 program=/usr/share/kibana/bin/kibana pidfile="/var/run/kibana/$name.pid"