-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7405 from jbudz/backport/6674
Backport PR #6674 to 4.x
- Loading branch information
Showing
7 changed files
with
99 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
user_check() { | ||
getent passwd "$1" > /dev/null 2>&1 | ||
} | ||
|
||
user_create() { | ||
# Create a system user. A system user is one within the system uid range and | ||
# has no expiration | ||
useradd -r "$1" | ||
} | ||
|
||
if ! user_check "<%= user %>" ; then | ||
user_create "<%= user %>" | ||
fi | ||
chown -R <%= user %>:<%= group %> /opt/kibana/optimize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
user_check() { | ||
getent passwd "$1" > /dev/null 2>&1 | ||
} | ||
|
||
user_remove() { | ||
userdel "$1" | ||
} | ||
|
||
REMOVE_USER=false | ||
|
||
case $1 in | ||
# Includes cases for all valid arguments, exit 1 otherwise | ||
# Debian | ||
purge) | ||
REMOVE_USER=true | ||
;; | ||
|
||
remove|failed-upgrade|abort-install|abort-upgrade|disappear|upgrade|disappear) | ||
;; | ||
|
||
# Red Hat | ||
0) | ||
REMOVE_USER=true | ||
;; | ||
|
||
1) | ||
;; | ||
|
||
*) | ||
echo "post remove script called with unknown argument \`$1'" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
if [ "$REMOVE_USER" = "true" ]; then | ||
if user_check "<%= user %>" ; then | ||
user_remove "<%= user %>" | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
echo -n "Stopping kibana service..." | ||
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 | ||
echo " OK" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters