On Thu 03 Apr 2014 17:27:44 Thomas Bächler wrote:
> Am 03.04.2014 17:13, schrieb Barry Scott:
> > But as soon as the script exits the mount.ntfs process is killed off by
> > something? systemd-udevd maybe?
> 
> From man udev's section on RUN:
> 
> "           This can only be used for very short-running foreground
> tasks. Running an event process for a long period of time may block all
> further events for this or a dependent device.
> 
>            Starting daemons or other long-running processes is not
> appropriate for udev; the forked processes, detached or not, will be
> unconditionally killed after the event handling has finished."
> 
> Instead of using RUN, use SYSTEMD_WANTS to start a .mount or .service
> unit that does your job. In the remove case, use
> RUN+="/usr/bin/systemctl stop --no-block foo.mount" or similar.
> 
> (Not that I think this is a good idea at all: Your volume will be
> "unmounted" after it has been remove already - you are asking for data
> corruption.)

I did not set out to run a daemon. Its looks on the surface like I'm just 
mounting a 
device. It was a partial a surprise that the mount.ntfs process was considered 
part of 
the udev CG (but I not sure where else it might be put).

What I have done is created a service that does the mount and umount actions 
triggered by the udev rule. I need the udev rule as I have cannot depend on any 
of the 
important properties of the USB device, its name, the FS type etc.

I'm not using the template mechanism, but will investigate it.

Barry

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to