On Tue, 27.01.15 17:22, Lennart Poettering (lenn...@poettering.net) wrote: > On Tue, 27.01.15 16:24, Martin Pitt (martin.p...@ubuntu.com) wrote: > > > > Well, again, the right answer then is to handle it with .mount units, > > > > How would that look like, on a very high level? Create .mount units on > > the fly with udev rules when devices appear, and asking systemd to > > unmount them via a remove uevent, instead of having cdrom_id do the > > umount directly? > > The .mount units of device nodes already have a BindsTo= dependency on > their respective backing .device units. This should have the effect > that systemd will take the .mount units down if the .device units are > removed. Are you saying that doesn't work?
So I figure the bit that is missing here is the fact that the .device units for CD drives and USB card readers don't care for media sense right now. The .device units for CD drives and USB card readers are available as long as the CD drive or USB card reader is plugged in, it doesn't care for any media being in it. That means that automatic unmounting by systemd due to the device going away will only happen if you actually unplug the CD driver or the USB card, but not already when the media is ejected. However, I think it would make a ton of sense to change that, and set SYSTEMD_READY=0 on all block devices where the media sensing suggests that no medium is in it. This would mean that these devices don't show up as systemd units until you actually put a medium in it. That would be a change of semantics, but I think a useful one. What do you think? Lennart -- Lennart Poettering, Red Hat _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel