[yocto] USBmount and systemd-udev namespace conflict
Francois P. Gallichand
francois.p.gallichand at ca.abb.com
Thu Dec 18 05:06:59 PST 2014
Hello,
I finally found a solution to my problem. In fact, the mounts made by udevd not being accessible to other processes comes from the way the system-udevd service is started. In the /lib/systemdsystem/system-udevd.service, I just remove the MountFlags=slave line and by doing that, all the mounts are shared (the default) and accessible by all the processes.
Regards,
François Gallichand
Engineer - Software Group
ABB Group
Analytical Business
(418)877-2944 x268
[ABB logo]
From: Li, Xin [mailto:lixin.fnst at cn.fujitsu.com]
Sent: Monday, December 15, 2014 8:23 PM
To: Francois P. Gallichand; yocto at yoctoproject.org
Subject: RE: USBmount and systemd-udev namespace conflict
Hi,
This is my way to use udev to automount a usb driver, perhaps it can help you.
1. Add udev rules.
root # cat /etc/udev/rules.d/10-udevtest.rules
KERNEL=="sda",ACTION=="add",OWNER:="udev",GROUP:="udevs"
2. Add user and group.
root # useradd udev
root # groupadd udevs
3. start the udev service
root # systemctl start systemd-udevd.service
root # ps aux | grep udev
root 21927 0.3 0.0 26140 1388 ? Ss 22:51 0:00 /lib/systemd/systemd-udevd
4. insert usb driver
5. check
root # ls /dev/sda -al
brw-rw---- 1 udev udevs 8, 0 Sep 15 03:13 /dev/sda
-----------------------------
Best regards,
Li
From: yocto-bounces at yoctoproject.org<mailto:yocto-bounces at yoctoproject.org> [mailto:yocto-bounces at yoctoproject.org] On Behalf Of Francois P. Gallichand
Sent: Tuesday, December 16, 2014 3:34 AM
To: yocto at yoctoproject.org<mailto:yocto at yoctoproject.org>
Subject: [yocto] USBmount and systemd-udev namespace conflict
Hello,
I need to automount a usb drive when it is plugged in. I found that the necessary udev rules are in the udev-extraconf package so I added that to my build. I tried it but it does not really work since when I insert the key, it is in fact mounted by udev but since the mount namespace of udev is private and not the same one as the shell I want to check if the key is mounted, I don’t see it. Is there a way to tell udev to mount using a global namespace so it can be seen be everybody?
Thanks.
François Gallichand
Engineer - Software Group
ABB Group
Analytical Business
(418)877-2944 x268
[ABB logo]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20141218/6f3a03a6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 3279 bytes
Desc: image001.png
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20141218/6f3a03a6/attachment.png>
More information about the yocto
mailing list