diff --git a/README.md b/README.md index 63f21e4..e6fe451 100644 --- a/README.md +++ b/README.md @@ -292,6 +292,22 @@ touch /mnt/tank/truenas-truecloud-patch/disabled systemctl restart middlewared ``` +If you don't remember where you cloned the repo (midclt won't work while middlewared is +down), find the path two ways: + +```bash +# Option 1 — search the filesystem: +find /mnt -name "recover.sh" -path "*/truenas-truecloud-patch/*" 2>/dev/null + +# Option 2 — query the TrueNAS database directly: +sqlite3 /data/freenas-v1.db \ + "SELECT script FROM initshutdownscript WHERE comment = 'TrueCloud provider patch (S3/B2)';" +``` + +The `script` column shows the full path to `patch/apply.sh`; your clone root is one +level up (strip `/patch/apply.sh` from the end). Then run the `touch` command above +with that path. + If middlewared **still** won't start after the kill switch is set, the problem is unrelated to this patch. Check: diff --git a/patch/create_task.py b/patch/create_task.py index 6630f72..69545c6 100755 --- a/patch/create_task.py +++ b/patch/create_task.py @@ -141,7 +141,7 @@ def cmd_list_tasks(client, _args): print("─" * 60) for t in sorted(tasks, key=lambda x: x["id"]): creds = t.get("credentials") or {} - ptype = creds.get("provider", {}).get("type", "?") + ptype = (creds.get("provider") or {}).get("type", "?") enabled = "yes" if t.get("enabled") else "no" print(f"{t['id']:>4} {enabled:<8} {ptype:<14} {t.get('description', '')}") diff --git a/patch/sitecustomize.py b/patch/sitecustomize.py index fd5dbee..f5d75d1 100644 --- a/patch/sitecustomize.py +++ b/patch/sitecustomize.py @@ -219,8 +219,6 @@ def _record_status(fullname: str, ok: bool, detail: str = "") -> None: if fullname in _hook_status: return # idempotent: first call wins _hook_status[fullname] = {"ok": ok, "detail": detail} - if len(_hook_status) < len(_Finder._targets): - return # wait for all patches; _Finder._targets is the canonical count payload = { "patched_at": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()),