-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not keep the directory handle open #3825
Comments
Apparently not a bug. |
mc along with its subshell change their working directory, just as e.g. your shell does when you cd there.
I agree with andrew_b, there's no bug here, this is the desired behavior. Switch away from that directory in order to unmount the device. |
We may argue whether this is a bug or not, but clearly it's not an intended behaviour as it complicates the lives of MC users.
Also, until the user actually ran some command in MC, I don't understand why MC needs to spawn a shell. Please explain why the shell is needed. |
Replying to birdie:
mc is not special here, I believe pretty much any other application (e.g. other terminal based or graphical file managers) would cause you this problem.
I know the frustration it causes, but the frustration would remain even if we changed mc's behavior. You'd still have to potentially find lots of other apps (including the shell from which you started mc) and terminate them.
This situation cries for a generic OS-wide solution, which could either be a standalone app showing all the apps that hold a file descriptor to a given mount point and offering to kill them, or to be able to force the unmount of a device and send input/output errors to apps that still hold a reference.
I don't think it's feasible for mc to work around a drawback of the generic Unix design.
The shell is not needed, you can launch mc -u that goes without the subshell. The current unmount problem remains with mc itself, though. Plus, you'll get limited usability. Those limitations that you'll see (e.g. lack of the usual prompt, to begin with) are the exact reasons a subshell is nice to have. |
imho, this should be closed |
Windows Explorer, FAR File Manager, Total Commander, etc. all allow to unmount (yes, there's such a thing in Windows) a device when these applications have a directory open on it and I don't understand why MC should follow any broken UNIX conventions.
Speaking of a general solution, there could be one, e.g. https://bugzilla.kernel.org/show_bug.cgi?id=14505 but it's super complicated and I don't expect the Linux kernel to have this call implemented until Linux is rewritten from scratch. |
Could maybe
|
Well, I was able to umount --lazy a mount point(of a mounted card reader's SDCard) [which without --lazy was busy (even with mc --nosubshell)] and so lsblk didn't list it anymore, thus I was even able to eject it. |
Important
This issue was migrated from Trac:
birdie
(aros@….com)egmont
(@egmontkob),howaboutsynergy@….me
When you enter any directory using MC, the device which directory belongs to, becomes "busy" and you cannot unmount it any longer.
Please fix it.
The text was updated successfully, but these errors were encountered: