fix(webui): app-log removal uses runFileOp rm -f so uninstall can't hang

The uninstall branch of webuiUpdateAppLog removed the per-app WebUI log
with a bare `rm`. The log lives in the container data plane and is owned
by the container user, often without a write bit. A bare rm (run as root
via `sudo init.sh uninstall`) prompts interactively for write-protected
files — which hangs an otherwise-unattended deploy: the uninstall phase
of a `full` redeploy stopped dead at "rm: remove write-protected regular
file '.../frontend/logs/apps/<app>.log'?".

Route it through runFileOp rm -f (as the container-data owner, force) to
match the neighbouring uninstall_app.sh and the install branch's
owner-aware createTouch/runFileWrite helpers. No prompt, correct owner.

Signed-off-by: librelad <librelad@digitalangels.vip>
This commit is contained in:
librelad 2026-05-28 13:46:16 +01:00
parent b9dfbb89d1
commit b7d95f5e95

View File

@ -22,9 +22,12 @@ webuiUpdateAppLog()
echo "=== LibrePortal Installation Started at $(date) ===" | runFileWrite "${log_file}" > /dev/null
fi
elif [[ "$type" == "uninstall" ]]; then
# Remove app log file
# Remove app log file via runFileOp (as the container-data owner) with
# -f: the log can be write-protected, and a bare rm prompts
# interactively for write-protected files, which hangs an unattended
# deploy (the uninstall phase of a 'full' redeploy).
if [ -f "${log_file}" ]; then
local result=$(rm "${log_file}")
local result=$(runFileOp rm -f "${log_file}")
checkSuccess "Removed ${app_name}.log"
fi
fi