vermaden / automount

Simple devd(8) based automounter for FreeBSD
66 stars 20 forks source link

Automatic unmounting? #16

Closed outpaddling closed 4 years ago

outpaddling commented 4 years ago

First, this is a nice utility, thanks!

One feature that would make it more functional would be an option to automatically unmount when the file manager exits.

I'm aware of the USERMOUNT option, but setting SUID on [u]mount commands thereby allowing any user to mount/unmount any volume is an unacceptable security issue on a multiuser system, such as a shared workstation in a lab.

vermaden commented 4 years ago

Welcome.About that 'feature', how would I do that? Keep the PID of started manager and if that exact PID exits then unmount the drive forcefully? I often do not use graphical manager but terminal to do something on the removable drive, sometimes its a rsync process that runs for hours. Doing force unmount just based on single Thunar or Caja PID seems rather risky decision. Not to mention that both Caja and Thunar like to crash once in a while 'just like that' which would force unmount the device.Regards,vermadenOd: "Jason Bacon" <notifications@github.com>Do: "vermaden/automount" <automount@noreply.github.com>; Wysłane: 2:46 Wtorek 2020-01-07Temat: [vermaden/automount] Automatic unmounting? (#16)First, this is a nice utility, thanks! One feature that would make it more functional would be an option to automatically unmount when the file manager exits. I'm aware of the USERMOUNT option, but setting SUID on [u]mount commands thereby allowing any user to mount/unmount any volume is an unacceptable security issue on a multiuser system, such as a shared workstation in a lab.

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.

outpaddling commented 4 years ago

I wouldn't force the unmount. I'd attempt it and ideally issue a popup if it fails, maybe using something like x11/zenity:

"/media/XXX failed to unmount. Be sure to unmount it manually before disconnecting."

trasz commented 4 years ago

Random idea: enable autounmount(8), which is in base, with a short timeout (eg ‘-t 3’), and make sure to mount filesystems with ‘-o automounted’?

outpaddling commented 4 years ago

Thanks for the suggestion. I'd thought of that, but you're aware of the current issues such as failing to unmount exFAT drives. That's why I'm exploring sysutils/automount as an alternative.

outpaddling commented 4 years ago

I have another idea that I think would work better. I'll create a simple SUID QT app that launches the FM as a child and creates a popup or tray icon with an unmount button. It can do an setuid() just for the umount command and can report when an unmount fails. Only filesystems mounted by automount can be unmounted under setuid() and no changes to automount needed, since it can already be configured to launch any command upon mounting.

vermaden commented 4 years ago

Interesting, please share that app when You write it :)Od: "Jason Bacon" <notifications@github.com>Do: "vermaden/automount" <automount@noreply.github.com>; Wysłane: 2:20 Piątek 2020-01-10Temat: Re: [vermaden/automount] Automatic unmounting? (#16)I have another idea that I think would work better. I'll create a simple SUID QT app that launches the FM as a child and creates a popup or tray icon with an unmount button. It can do an setuid() just for the umount command and can report when an unmount fails. Only filesystems mounted by automount can be unmounted under setuid() and no changes to automount needed, since it can already be configured to launch any command upon mounting.

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.

outpaddling commented 4 years ago

I'll add it to ports and note that it's intended as a companion to sysutils/automount.