[build] Attempt to stop service pre-install

This commit is contained in:
Jonathan Budzenski 2016-05-09 14:40:05 -05:00
parent 83c580298f
commit 6c6e4d31ff
3 changed files with 16 additions and 3 deletions

View file

@ -29,6 +29,7 @@ module.exports = function (grunt) {
'--maintainer', 'Kibana Team\ \<info@elastic.co\>',
'--license', 'Apache\ 2.0',
'--after-install', resolve(packageScriptsDir, 'post_install.sh'),
'--before-install', resolve(packageScriptsDir, 'pre_install.sh'),
'--before-remove', resolve(packageScriptsDir, 'pre_remove.sh'),
'--after-remove', resolve(packageScriptsDir, 'post_remove.sh'),
'--config-files', '/opt/kibana/config/kibana.yml',

View file

@ -0,0 +1,13 @@
#!/bin/sh
if command -v systemctl >/dev/null && systemctl is-active kibana.service >/dev/null; then
systemctl --no-reload stop kibana.service
elif [ -x /etc/init.d/kibana ]; then
if command -v invoke-rc.d >/dev/null; then
invoke-rc.d kibana stop
elif command -v service >/dev/null; then
service kibana stop
else
/etc/init.d/kibana stop
fi
fi

View file

@ -1,10 +1,9 @@
#!/bin/sh
echo -n "Stopping kibana service..."
if command -v systemctl >/dev/null; then
if command -v systemctl >/dev/null && systemctl is-active kibana.service >/dev/null; then
systemctl --no-reload stop kibana.service
fi
if [ -x /etc/init.d/kibana ]; then
elif [ -x /etc/init.d/kibana ]; then
if command -v invoke-rc.d >/dev/null; then
invoke-rc.d kibana stop
elif command -v service >/dev/null; then