update: use is-enabled not is-active before restart

Otherwise we do not restart services that have stopped due to an issue.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2024-07-23 09:57:30 +02:00
parent 019b2d269d
commit 8f20340103
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
2 changed files with 2 additions and 2 deletions

View File

@ -76,7 +76,7 @@ fi
{% if beacon_node_update_restarts_service %}
# Avoid faiure on first Ansible run due to missing service.
if [[ $(systemctl is-active "${SERVICE}" || true) == "inactive" ]]; then
if [[ $(systemctl is-enabled "${SERVICE}" || true) != "enabled" ]]; then
echo " !!! No service to restart!"
exit
else

View File

@ -64,7 +64,7 @@ fi
{% if beacon_node_update_restarts_service %}
# Avoid faiure on first Ansible run due to missing service.
if [[ $(systemctl is-active "${SERVICE}" || true) == "inactive" ]]; then
if [[ $(systemctl is-enabled "${SERVICE}" || true) != "enabled" ]]; then
echo " !!! No service to restart!"
exit
else