Skip to content

Commit

Permalink
[deb/rpm] On upgrade, restart kibana service (elastic#82049)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
jbudz and kibanamachine committed Nov 9, 2020
1 parent 694c322 commit 7395355
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 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 [ "$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
3 changes: 2 additions & 1 deletion src/dev/build/tasks/os_packages/run_fpm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ export async function runFpm(
`dataDir=/var/lib/kibana`,
'--template-value',
`logDir=/var/log/kibana`,

'--template-value',
`envFile=/etc/default/kibana`,
// config and data directories are copied to /usr/share and /var/lib
// below, so exclude them from the main package source located in
// /usr/share/kibana/config. PATHS MUST BE RELATIVE, so drop the leading slash
Expand Down
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"
RESTART_ON_UPGRADE="true"

0 comments on commit 7395355

Please sign in to comment.