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:
parent
e2cbec185b
commit
b6016b6e1e
|
@ -68,7 +68,7 @@ fi
|
|||
|
||||
if [ "$REMOVE_SERVICE" = "true" ]; 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
|
||||
|
||||
if command -v chkconfig >/dev/null; then
|
||||
|
|
|
@ -116,11 +116,6 @@ setup() {
|
|||
# The removal must disable the service
|
||||
# see prerm file
|
||||
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
|
||||
[ "$status" -eq 1 ]
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue