[systemd-devel] systemd-udevd seems to kill mount.ntfs started in rules scripts?

Lennart Poettering lennart at poettering.net
Tue Apr 22 21:27:13 PDT 2014


On Thu, 03.04.14 16:13, Barry Scott (barry.scott at onelan.co.uk) wrote:

> More of my porting from F16 to F20.
> 
> I have the following in /etc/udev/rules.d
> 
> ACTION=="add", SUBSYSTEM=="block", SUBSYSTEMS=="usb", 
> RUN+="/usr/local/onelan/ntb/bin/ntb_mount_usb"
> ACTION=="remove", SUBSYSTEM=="block", SUBSYSTEMS=="usb", 
> RUN+="/usr/local/onelan/ntb/bin/ntb_mount_usb"
> 
> This run the ntb_mount_usb script as expected.
> 
> The script on the ADD action ends up doing:
> 
> mount -t ntfs -o uid=onelan,gid=onelan,noatime,noexec ${DEVNAME} /my-mount-
> point

As mentioned by others in this trhead, you need to invoke such scripts
as systemd units, as we'll kill all remaining worker processes after we
are done with all the work from udev.

Also note that very recent udev versions will run in their own mount
namespace, which disables propagation of mounts from udev to the
host. Hence, if you want to mount something from udev, the best approach
is to simply use nofail in fstab, and if you need more complex matches
pulling in the .mount unit via SYSTEMD_WANTS from an udev rule.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list