mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[build] template user in install/remove scripts
This commit is contained in:
parent
08c9897986
commit
53871671e2
3 changed files with 7 additions and 6 deletions
|
@ -31,7 +31,8 @@ module.exports = function (grunt) {
|
|||
'--after-install', resolve(packageScriptsDir, 'post_install.sh'),
|
||||
'--before-remove', resolve(packageScriptsDir, 'pre_remove.sh'),
|
||||
'--after-remove', resolve(packageScriptsDir, 'post_remove.sh'),
|
||||
'--config-files', '/opt/kibana/config/kibana.yml'
|
||||
'--config-files', '/opt/kibana/config/kibana.yml',
|
||||
'--template-value', 'user=kibana'
|
||||
];
|
||||
|
||||
const files = buildDir + '/=/opt/kibana';
|
||||
|
|
|
@ -10,7 +10,7 @@ user_create() {
|
|||
useradd -r "$1"
|
||||
}
|
||||
|
||||
if ! user_check "kibana" ; then
|
||||
user_create "kibana"
|
||||
if ! user_check "<%= user %>" ; then
|
||||
user_create "<%= user %>"
|
||||
fi
|
||||
chown kibana /opt/kibana/optimize
|
||||
chown <%= user %> /opt/kibana/optimize
|
||||
|
|
|
@ -10,8 +10,8 @@ user_remove() {
|
|||
|
||||
case $1 in
|
||||
purge|0)
|
||||
if user_check "kibana" ; then
|
||||
user_remove "kibana"
|
||||
if user_check "<%= user %>" ; then
|
||||
user_remove "<%= user %>"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue