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 <noreply@anthropic.com>
This commit is contained in:
sysopsandClaude Sonnet 5 committed 2026-07-10 18:23:20 +02:00
1 parent 41894e67c6
commit 6eeea65ede
1 file changed
+3 -2
+3 -2
View File
@@ -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")"