From 8b00873da2d5f333f58a2f02fda6382b2caef211 Mon Sep 17 00:00:00 2001 From: Daniel Maksymilian Syrnicki Date: Wed, 15 Apr 2026 09:24:05 +0200 Subject: [PATCH] fix(webinstaller): delay reboot so the rebooting page can fetch CSS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The reboot route fired systemctl reboot in parallel with returning the rebooting HTML. The browser's follow-up request for /static/style.css was racing the shutdown — often the server was already gone, leaving the page unstyled (inline SVG rendered at full viewBox size, filling the screen). A small sleep gives the browser time to pull CSS + icons before the network drops. Co-Authored-By: Claude Opus 4.6 (1M context) --- webinstaller/app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webinstaller/app.py b/webinstaller/app.py index 306ecfe..f7722ee 100644 --- a/webinstaller/app.py +++ b/webinstaller/app.py @@ -632,8 +632,11 @@ def install_reboot(): log = INSTALL_LOG.read_text() if INSTALL_LOG.exists() else "" if parse_install_progress(log)["status"] != "done": return redirect(url_for("install_log_view")) + # Delay reboot a few seconds so the browser can finish fetching CSS / assets + # for the rebooting page before the Flask server (and network) go away. + # Without this, the reboot page renders unstyled (giant inline SVG icon). subprocess.Popen( - ["/usr/bin/systemctl", "reboot"], + ["/bin/sh", "-c", "sleep 3 && /usr/bin/systemctl reboot"], start_new_session=True, ) return render_template("install/rebooting.html")