Bats testing: Remove useless systemctl check

Bats testing uncovered a useless systemctl check, that resulted in an
error, because the systemctl file was uninstalled, but we hoped to
check for an explicetely configured SystemExitCode.

In addition we did not reload the systemctl configuration when uninstalling
elasticsearch, which now is fixed as well.

Closes #12682
This commit is contained in:
Alexander Reelsen 2015-08-07 14:23:46 +02:00
parent e2cbec185b
commit b6016b6e1e
2 changed files with 1 additions and 6 deletions

View File

@ -68,7 +68,7 @@ fi
if [ "$REMOVE_SERVICE" = "true" ]; then if [ "$REMOVE_SERVICE" = "true" ]; then
if command -v systemctl >/dev/null; then if command -v systemctl >/dev/null; then
systemctl --no-reload disable elasticsearch.service > /dev/null 2>&1 || true systemctl disable elasticsearch.service > /dev/null 2>&1 || true
fi fi
if command -v chkconfig >/dev/null; then if command -v chkconfig >/dev/null; then

View File

@ -116,11 +116,6 @@ setup() {
# The removal must disable the service # The removal must disable the service
# see prerm file # see prerm file
if is_systemd; then if is_systemd; then
# Redhat based systemd distros usually returns exit code 1
# OpenSUSE13 returns 0
run systemctl status elasticsearch.service
[ "$status" -eq 1 ] || [ "$status" -eq 0 ]
run systemctl is-enabled elasticsearch.service run systemctl is-enabled elasticsearch.service
[ "$status" -eq 1 ] [ "$status" -eq 1 ]
fi fi