From 351800620534fef03773241fdbbe9807e39f0f3e Mon Sep 17 00:00:00 2001 From: librelad Date: Fri, 28 Aug 2026 06:38:07 +0100 Subject: [PATCH] relocate: rewrite the manager's crontab when a root moves MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit libreportal-relocate re-bakes the helpers, the systemd unit and the WebUI compose, but never touched the manager's crontab — and the @reboot entry embeds an absolute path under the SYSTEM dir: @reboot /libreportal-system/install/scripts/crontab/system/crontab_boot_app_reconcile.sh Move that root and the path stops existing. The entry is redirected to /dev/null, so nothing reports it; the only symptom is that apps quietly do not come back after a reboot, which is easy to blame on anything else. Rewrite it with the same old->new substitution already applied to the unit and compose, keeping a copy in the relocation's backup dir first. (A fresh install is unaffected — it generates the entry with the resolved install_scripts_dir. Verified on a matrix case-4 install with all three roots on test disks: the entry points at /mnt/lptest1/... and the target exists.) Co-Authored-By: Claude Opus 5 --- scripts/system/libreportal-relocate | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/system/libreportal-relocate b/scripts/system/libreportal-relocate index dadce92..f18769d 100755 --- a/scripts/system/libreportal-relocate +++ b/scripts/system/libreportal-relocate @@ -235,6 +235,23 @@ if [[ -f "$COMPOSE" ]]; then ok "WebUI compose bind-mounts" fi +# ---- 4b. the manager's crontab ------------------------------------------------ +# The @reboot boot-reconcile entry embeds an absolute path under the SYSTEM dir +# ("${install_scripts_dir}crontab/system/crontab_boot_app_reconcile.sh"). Move +# that root and the path stops existing — and the entry is redirected to +# /dev/null, so nothing reports it. The only symptom is that apps quietly do not +# come back after a reboot, which is easy to blame on anything else. +if crontab -u "$MANAGER" -l >/dev/null 2>&1; then + crontab -u "$MANAGER" -l > "$BACKUP_DIR/crontab.$MANAGER" 2>/dev/null + if sed -e "s#${CUR_SYSTEM}#${FIN_SYSTEM}#g" \ + -e "s#${CUR_CONTAINERS}#${FIN_CONTAINERS}#g" \ + "$BACKUP_DIR/crontab.$MANAGER" | crontab -u "$MANAGER" - 2>/dev/null; then + ok "manager crontab" + else + warn "could not rewrite ${MANAGER}'s crontab — check 'crontab -l -u $MANAGER'" + fi +fi + # ---- 5. ownership on the new trees ------------------------------------------- say "Reconciling ownership" "$LIB_DIR/libreportal-ownership" reconcile >/dev/null 2>&1 && ok "ownership reconciled" \