@oxyhyxo at first glance it seems that the unmounting is attempted after the user logged out.
@beckermatic @oxyhyxo Or before. And some processes, say login shell, are still running and fs is busy.

@anparker

this feels more accurate to me, like something is still holding file-descriptors open on the mount-point. If the unmount-script is in that home-directory, it might be the culprit (so you might try moving the script to something outside the /home mount-point like /opt/bin and run it from there. It might also be that something still has that mounted-location as its $CWD, so your script might need to do something like `cd /` at the top to move out of the directory.

You might be able to use something like lsof(1) or fstat(1) right before you unmount, dumping the open file-descriptors to some user-writable location like /tmp and see if there are any obvious culprits holding things open in $HOME

@beckermatic @oxyhyxo