Messages in this thread | | | Date | Sun, 2 Jan 2005 21:56:50 +0100 | From | Pavel Machek <> | Subject | Re: the umount() saga for regular linux desktop users |
| |
Hi! > > > > Well, umount -l can be handy, but it does not allow you to get your CD > > > > back from the drive. > > > > > > > > umount --kill that kills whoever is responsible for filesystem being > > > > busy would solve part of the problem (that can be done in userspace, > > > > today). > > > >... > > > > > > What's wrong with > > > > > > fuser -k /mnt && umount /mnt > > > > 1. Would need suid. > > It needs suid only if you aren't root and you want to kill processes you > don't own. > > Yes, this might cause problems e.g. if users are allowed to mount their > cdroms, but simply allowing them to kill processes of other users who > access this device isn't a solution, too. > > > 2. Is a mindless slaughter of important processes. > > It's what Pavel wanted to get included in umount. > > Usually, you'll let fuser give you the list of processes and inspect > them manually. > > > 3. Is a race condition. > > Then put it into a while loop that executes until umount returns 0. > > I still fail to see why I should implement half of fuser in umount. > Either you are working at the command line and know about fuser or you > are working through a GUI which can offer you a "kill all applications > accessing this device" button that calls fuser.
Okay, so the right solution is probably something more like
while umount /mnt; do fuser -km -TERM /mnt sleep 1 fuser -km /mnt done
Not sure how many command line users can do this... Perhaps including fumount script doing this is good idea? Pavel -- People were complaining that M$ turns users into beta-testers... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl! - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |