[systemd-devel] [PATCH] cdrom_id: unmount media on --eject-media if media mounted

Martin Pitt martin.pitt at ubuntu.com
Thu Jan 15 06:42:28 PST 2015

Hey Robert,

thanks for working on this!

Robert Milasan [2015-01-15 15:24 +0100]:
> +                        err = execl("/bin/umount", "/bin/umount",
> node, NULL);

If this succeeds, umount will completely "take over" the process, and
cdrom_id is gone.

This also isn't sufficient if there are multiple partitions, which
even on CDs/DVDs isn't that uncommon (especially for operating

So I think this should instead find all mount points that belong to
target, and call umount2(target, MNT_DETACH) on them. The actual
"eject" program does that.

... which leads me to the question: why don't we just call the actual
"eject" program? Just to avoid that dependency?



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

More information about the systemd-devel mailing list