From e8849fefceba7b7ef0a626170ea64bcd7107e60f Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 4 Jul 2024 19:13:43 +0200 Subject: [PATCH] aptitude_with_progress_bar: delay the yunohost-api restart such that the migration doesnt appear as failed from the webamin --- src/utils/system.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/utils/system.py b/src/utils/system.py index 105aea704..690c8f3c8 100644 --- a/src/utils/system.py +++ b/src/utils/system.py @@ -287,6 +287,11 @@ def aptitude_with_progress_bar(cmd): f'LC_ALL=C DEBIAN_FRONTEND=noninteractive APT_LISTCHANGES_FRONTEND=none aptitude {cmd} --quiet=2 -o=Dpkg::Use-Pty=0 -o "APT::Status-Fd=$YNH_STDINFO"' ) + # If upgrading yunohost from the API, delay the Yunohost-api restart + # (this should be the last time we need it before bookworm, because on bookworm, yunohost-admin cookies will be persistent upon api restart) + if " yunohost " in cmd and Moulinette.interface.type == "api": + cmd = "YUNOHOST_API_RESTART_WILL_BE_HANDLED_BY_YUNOHOST=yes " + cmd + logger.debug(f"Running: {cmd}") ret = call_async_output(cmd, callbacks, shell=True)