helpers2.1: when using ynh_systemctl to reload/start/restart a service with a wait_until and it timesout, handle it as a filure rather than keep going

This commit is contained in:
Alexandre Aubin 2024-06-23 14:36:55 +02:00
parent 9298738d06
commit b3409729a6

View file

@ -162,6 +162,13 @@ ynh_systemctl() {
ynh_print_warn "===" ynh_print_warn "==="
tail --lines=$length "$log_path" >&2 tail --lines=$length "$log_path" >&2
fi fi
# If we tried to reload/start/restart the service but systemctl consider it to be still inactive/broken, then handle it as a failure
if ([ "$action" == "reload" ] || [ "$action" == "start" ] || [ "$action" == "restart" ]) && ! systemctl --quiet is-active $service
then
_ynh_clean_check_starting
return 1
fi
fi fi
_ynh_clean_check_starting _ynh_clean_check_starting
fi fi