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")