[systemd-devel] [PATCH] systemd-udevd.service: restore mount propagation

Martin Pitt martin.pitt at ubuntu.com
Tue Jan 27 07:24:55 PST 2015

Lennart Poettering [2015-01-27 13:52 +0100]:
> So, why is this a new problem, and why do you say that
> MountFlags=slave broke anything?

I didn't say that. :-) I just said that due to this the two proposed
solutions of cleaning up the mounts after CD ejection won't work.

> I mean, cdrom_id cannot do unmounts (and it really shouldn't), And
> an "eject" invocation was never part of the udev rules, so there was
> really nothing that broke. So, these things never worked, and
> MountFlags=slave didn't change anything about it.


> > udisks actually used to have both the CD-ROM polling (which since then
> > moved into the kernel) and the post-eject cleanup.
> Why was the removed, and with what was it replaced when it was?

So udisks 1.x had a force_removal() function which was called on a
remove uevent and cleaned up stale mounts. Apparenlty that never made
it into the udisks 2.x rewrite unless I'm missing something. But as it
obviously doesn't seem to work right now (i. e. CD mounts are kept
stale), I guess it's due to that.

> 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?


Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

More information about the systemd-devel mailing list