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

2015-01-16 Thread Karel Zak
On Thu, Jan 15, 2015 at 03:42:28PM +0100, Martin Pitt wrote: > ... which leads me to the question: why don't we just call the actual > "eject" program? Just to avoid that dependency? BTW, eject is maintained in util-linxu now, and it's based on libmount and sysfs stuff we have in util-linux (and

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

2015-01-16 Thread Oliver Neukum
On Thu, 2015-01-15 at 15:47 +0100, Robert Milasan wrote: > > ... which leads me to the question: why don't we just call the > actual > > "eject" program? Just to avoid that dependency? > > Yes, we could do this, I didn't think of it :) I can confirm this to work and it is better than duplicating

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

2015-01-15 Thread Kay Sievers
On Thu, Jan 15, 2015 at 5:13 PM, Robert Milasan wrote: > On Thu, 15 Jan 2015 17:05:54 +0100 > "Lennart Poettering" wrote: >> >> I think the best way to fix this is in the kernel properly. And if the >> kernel folks are not willing to do add code for that, then I think >> it's still better to make

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

2015-01-15 Thread Robert Milasan
On Thu, 15 Jan 2015 17:05:54 +0100 "Lennart Poettering" wrote: > > I think the best way to fix this is in the kernel properly. And if the > kernel folks are not willing to do add code for that, then I think > it's still better to make sure systemd unmounts it. It can do so > asynchronously, simpl

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

2015-01-15 Thread Lennart Poettering
On Thu, 15.01.15 15:24, Robert Milasan (rmila...@suse.com) wrote: > Signed-off-by: Robert Milasan Humm, I am not convinced that this is really a good idea, first of all it's pretty incomplete, given that there atons of ways how a device can be kept busy, and mounts are just one of it. And even m

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

2015-01-15 Thread Robert Milasan
On Thu, 15 Jan 2015 15:42:28 +0100 "Martin Pitt" wrote: > 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" th

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

2015-01-15 Thread Martin Pitt
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 mu

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

2015-01-15 Thread Robert Milasan
Signed-off-by: Robert Milasan --- src/udev/cdrom_id/cdrom_id.c | 35 +++ 1 file changed, 35 insertions(+) diff --git a/src/udev/cdrom_id/cdrom_id.c b/src/udev/cdrom_id/cdrom_id.c index 6052f6a..72a1357 100644 --- a/src/udev/cdrom_id/cdrom_id.c +++ b/src/udev/cdrom