Skip to content

Commit

Permalink
[deb/rpm] On upgrade, restart kibana service
Browse files Browse the repository at this point in the history
This adds a new environment variable KBN_RESTART_ON_UPGRADE with a
default value of true.  In an upgrade scenario Kibana will automatically
restart.

Closes elastic#9863
  • Loading branch information
jbudz committed Oct 29, 2020
1 parent 4ca013e commit e07f2d4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
13 changes: 13 additions & 0 deletions src/dev/build/tasks/os_packages/package_scripts/post_install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/sh
set -e

# source the default env file
if [ -f "-<%= envFile %>" ]; then
. "envFile}"
fi

export KBN_PATH_CONF=${KBN_PATH_CONF:-<%= configDir %>}

set_chmod() {
Expand Down Expand Up @@ -71,4 +76,12 @@ if [ "$IS_UPGRADE" = "true" ]; then
if command -v systemctl >/dev/null; then
systemctl daemon-reload
fi

if ["$KBN_RESTART_ON_UPGRADE" = "true"]; then
echo -n "Restarting kibana service..."
if command -v systemctl >/dev/null; then
systemctl restart kibana.service || true
fi
echo " OK"
fi
fi
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
user="kibana"
group="kibana"
chroot="/"
chdir="/"
nice=""


# If this is set to 1, then when `stop` is called, if the process has
# not exited within a reasonable time, SIGKILL will be sent next.
# The default behavior is to simply log a message "program stop failed; still running"
KILL_ON_STOP_TIMEOUT=0

KBN_PATH_CONF="/etc/kibana"
KBN_RESTART_ON_UPGRADE="true"

0 comments on commit e07f2d4

Please sign in to comment.