From 1c127bdbd17e0ae0bdc6539750bd7f9bab90df41 Mon Sep 17 00:00:00 2001 From: pletch <17855860+pletch@users.noreply.github.com> Date: Sat, 3 Oct 2026 11:55:59 -0400 Subject: [PATCH] fix(install): restart guacd when it is running, not only rustguac make install replaces guacd's binary and libraries while the old guacd is still running, and the end of the install restarted rustguac alone. Requires= starts a stopped guacd but never restarts a running one, so an upgrade rebuilt guacd and then went on serving the previous build until someone restarted it by hand -- which looks exactly like a guacd change that did nothing. guacd is now restarted, ahead of rustguac, whenever it is active. Nothing is cut off by it: sessions go through rustguac, which is already stopped for the upgrade or was never running. A first install still leaves both stopped. --- install.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index a4d66c13..7277294e 100755 --- a/install.sh +++ b/install.sh @@ -656,8 +656,25 @@ rm -rf "$BUILD_DIR" # --------------------------------------------------------------------------- # Restart, if this was an upgrade of a running service # --------------------------------------------------------------------------- -# Only when it was already running. A first install leaves it stopped so that -# an admin account can be created before anything is reachable. +# guacd first, and whenever it is running. `make install` replaced its binary +# and libraries above, but a running guacd keeps executing the old ones, and +# restarting rustguac does not touch it: Requires= starts a stopped guacd and +# never restarts a running one. So an upgrade otherwise rebuilt guacd and then +# went on serving the previous build until someone restarted it by hand. Live +# sessions are not a concern here -- they go through rustguac, which is +# already stopped for the upgrade or was never running. +if systemctl is-active --quiet rustguac-guacd 2>/dev/null; then + info "Restarting guacd..." + systemctl restart rustguac-guacd + sleep 1 + if ! systemctl is-active --quiet rustguac-guacd; then + error "guacd did not come back up. Check: journalctl -u rustguac-guacd -n 50" + exit 1 + fi +fi + +# rustguac only when it was already running. A first install leaves it stopped +# so that an admin account can be created before anything is reachable. if [[ "${WAS_RUNNING:-0}" -eq 1 ]]; then info "Restarting rustguac..." systemctl restart rustguac