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:
co-authored by
Claude Sonnet 5
parent
41894e67c6
commit
6eeea65ede
+3
-2
@@ -45,8 +45,9 @@ mkdir -p "$DATA_DIR"
|
|||||||
mkdir -p "$HOOKS_DIR"
|
mkdir -p "$HOOKS_DIR"
|
||||||
|
|
||||||
echo "Installing binary to $BIN_DST..."
|
echo "Installing binary to $BIN_DST..."
|
||||||
cp "$BIN_SRC" "$BIN_DST"
|
cp "$BIN_SRC" "${BIN_DST}.new"
|
||||||
chmod 0755 "$BIN_DST"
|
chmod 0755 "${BIN_DST}.new"
|
||||||
|
mv -f "${BIN_DST}.new" "$BIN_DST"
|
||||||
|
|
||||||
echo "Installing UI assets to $UI_DST..."
|
echo "Installing UI assets to $UI_DST..."
|
||||||
mkdir -p "$(dirname "$UI_DST")"
|
mkdir -p "$(dirname "$UI_DST")"
|
||||||
|
|||||||
Reference in New Issue
Block a user