Skip to content

Commit

Permalink
Merge pull request #7498 from elastic/jasper/backport/7422/4.x
Browse files Browse the repository at this point in the history
[backport] PR #7422 to 4.x
  • Loading branch information
jbudz authored Jun 17, 2016
2 parents 0d7c0df + 2da2f4f commit 8bbbfe4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
3 changes: 2 additions & 1 deletion tasks/build/osPackages.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export default (grunt) => {
'--config-files', config.path.kibanaConfig,
'--template-value', `user=${config.user}`,
'--template-value', `group=${config.group}`,
'--template-value', `optimizeDir=${config.path.home}/optimize`
'--template-value', `optimizeDir=${config.path.home}/optimize`,
'--template-value', `pluginsDir=${config.path.plugins}`
];
const debOptions = [
'-t', 'deb',
Expand Down
18 changes: 17 additions & 1 deletion tasks/build/package_scripts/post_remove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,26 @@ user_remove() {
}

REMOVE_USER=false
REMOVE_DIRS=false

case $1 in
# Includes cases for all valid arguments, exit 1 otherwise
# Debian
purge)
REMOVE_USER=true
REMOVE_DIRS=true
;;
remove)
REMOVE_DIRS=true
;;

remove|failed-upgrade|abort-install|abort-upgrade|disappear|upgrade|disappear)
failed-upgrade|abort-install|abort-upgrade|disappear|upgrade|disappear)
;;

# Red Hat
0)
REMOVE_USER=true
REMOVE_DIRS=true
;;

1)
Expand All @@ -40,3 +46,13 @@ if [ "$REMOVE_USER" = "true" ]; then
user_remove "<%= user %>"
fi
fi

if [ "$REMOVE_DIRS" = "true" ]; then
if [ -d "<%= optimizeDir %>" ]; then
rm -rf "<%= optimizeDir %>"
fi

if [ -d "<%= pluginsDir %>" ]; then
rm -rf "<%= pluginsDir %>"
fi
fi
4 changes: 2 additions & 2 deletions tasks/config/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export default (grunt) => {
const PREFIX_PRODUCTION_RPM = `${FOLDER_PRODUCTION}/${FOLDERNAME_RPM}`;

const FOLDER_CONFIG = '/opt/kibana/config';
const FOLDER_LOGS = '/var/log/kibana';
const FOLDER_HOME = '/opt/kibana';
const FOLDER_PLUGINS = `${FOLDER_HOME}/installedPlugins`;

const FILE_KIBANA_CONF = `${FOLDER_CONFIG}/kibana.yml`;
const FILE_KIBANA_BINARY = `${FOLDER_HOME}/bin/kibana`;
Expand Down Expand Up @@ -43,7 +43,7 @@ export default (grunt) => {
version: VERSION,
path: {
conf: FOLDER_CONFIG,
logs: FOLDER_LOGS,
plugins: FOLDER_PLUGINS,
home: FOLDER_HOME,
kibanaBin: FILE_KIBANA_BINARY,
kibanaConfig: FILE_KIBANA_CONF
Expand Down

0 comments on commit 8bbbfe4

Please sign in to comment.