From 6eeea65edecfe66872d9ff539076284d0c30cd79 Mon Sep 17 00:00:00 2001 From: sysops Date: Fri, 10 Jul 2026 18:23:20 +0200 Subject: [PATCH] Fix "Text file busy" on reinstall while service is running cp truncates the destination in place, which fails with ETXTBSY when the binary is currently executing (e.g. running update.sh while the systemd service is active). Copy to a temp file and mv it into place instead - mv is a rename within the same filesystem, which the kernel allows even for a running binary. Co-Authored-By: Claude Sonnet 5 --- scripts/install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 16bcb54..2bdd216 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -45,8 +45,9 @@ mkdir -p "$DATA_DIR" mkdir -p "$HOOKS_DIR" echo "Installing binary to $BIN_DST..." -cp "$BIN_SRC" "$BIN_DST" -chmod 0755 "$BIN_DST" +cp "$BIN_SRC" "${BIN_DST}.new" +chmod 0755 "${BIN_DST}.new" +mv -f "${BIN_DST}.new" "$BIN_DST" echo "Installing UI assets to $UI_DST..." mkdir -p "$(dirname "$UI_DST")"