gitea-backup-pull: skip unmount (no error) if another process is busy on WSD2L840
rc.unassigned umount always does a lazy unmount and reports success unconditionally, even with an open cwd on the mountpoint - it never actually refuses on its own. Check with fuser -m first instead, and just leave the disk mounted if anything is using it.
This commit is contained in:
@@ -490,9 +490,23 @@ The SSH keypair needed no special handling: Unraid already auto-mirrors
|
||||
testing this: the script itself `cd`s into the mounted directory, so
|
||||
without explicitly `cd`ing back out first, the unmount would fail with
|
||||
"target is busy" (the shell's own working directory still being on the
|
||||
device it's trying to unmount). Verified both directions: already
|
||||
mounted → stays mounted after; not mounted → gets mounted, used, and
|
||||
unmounted again, with no "busy" error.
|
||||
device it's trying to unmount).
|
||||
- **Also checks for any *other* process still using the disk before
|
||||
unmounting, and gives up quietly (no error) if it finds one.** This
|
||||
turned out to be necessary rather than just nice-to-have: the
|
||||
Unassigned Devices plugin's own `rc.unassigned umount` always does a
|
||||
*lazy* (`-l`) unmount and reports "success" unconditionally — verified
|
||||
live that it does **not** refuse, error, or even notice when another
|
||||
process still has the mountpoint open (a single-device call is never
|
||||
the "force" path that would otherwise kill blocking processes first).
|
||||
So the script runs its own `fuser -m` check first and simply skips
|
||||
calling `rc.unassigned umount` at all if anything turns up, logging a
|
||||
plain informational line rather than an error and leaving the disk
|
||||
mounted for next time. Verified all three states end-to-end: already
|
||||
mounted before the run → untouched either way; not mounted, nothing
|
||||
else using it → mounted, used, and cleanly unmounted again; not
|
||||
mounted, but something else `cd`s into it mid-run → mounted, used, and
|
||||
correctly left mounted with no error.
|
||||
|
||||
**Restore path, if ever needed**: manual and deliberate — stop the target
|
||||
Gitea container, unpack the chosen dump's DB/repos/etc. into `/data` per
|
||||
|
||||
Reference in New Issue
Block a user