Bug 8613 - udev-extraconf: automount does not work with systemd >= 219
Summary: udev-extraconf: automount does not work with systemd >= 219
Status: RESOLVED FIXED
Alias: None
Product: General Runtime
Classification: Runtime
Component: General Runtime (show other bugs)
Version: 1.8
Hardware: All Multiple
: Medium normal
Target Milestone: 1.8.3
Assignee: Alejandro Hernandez
QA Contact:
URL:
Whiteboard: Check 2.0 also
Depends on:
Blocks:
 
Reported: 2015-10-29 14:54 UTC by Frederico Cadete
Modified: 2017-12-06 16:49 UTC (History)
0 users

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederico Cadete 2015-10-29 14:54:03 UTC
With systemd 219 and higher, systemd-udevd.service now has MountFlags=slave.
This means that udevd runs in its own mount namespace. Whatever udev rules mount, it will only be visible inside that namespace. See [1].

The result is that after upgrading to Yocto, the mount directory is correctly created inside /run/media/sda1 but processes in the global mount namespace will see that directory as empty.

Workaround hack: patch systemd-udevd.service to have MountFlags=shared, which reverts to the previous behavior. I am not sure this is desirable. I don't really understand the motivation behind this systemd change and what is the proper way of doing automounts from the systemd perspective.

[1] https://github.com/systemd/systemd/commit/c2c13f2df42e0691aecabe3979ea81cd7faa35c7
Comment 1 Alejandro Hernandez 2016-05-26 18:34:17 UTC
After doing some research, I believe the best option is to manually specify MountFlags=slave which was the default before, also other distros are doing it too.
Comment 2 Alejandro Hernandez 2016-05-26 18:35:22 UTC
This patch is a backport from debian, and fizes the issue on master, I will backport it and request for it to be merged.

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=f2092e67ea880301058396b831a9a18905317d0d
Comment 3 Alejandro Hernandez 2016-05-26 20:00:44 UTC
Just clarifying that we DONT specify MountFlags=slave, that was a typo