Bug 56203

Summary: Race condition for service dependent on mount
Product: systemd Reporter: David Strauss <david>
Component: generalAssignee: systemd-bugs
Status: RESOLVED WORKSFORME QA Contact: systemd-bugs
Severity: major    
Priority: medium CC: david
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description David Strauss 2012-10-19 20:26:48 UTC
If a service depends on a mount, systemd doesn't properly wait for the mount to complete before starting the service. This creates race conditions where the service may write to the mount directory before the mount is active, which can stop the mount from even completing successfully because the mount directory isn't empty. We might be able to stop the writes through permissions on the mount directory, but the writes would still fail.

The cleanest solution to this seems to be "notify" integration into the mount utility so it tells systemd that the mount is complete or waiting for the mount request to complete in some other way.

Part of why we use this dependency is to perform the mount before "forking" the file system namespace for the dependent service. This allows the dependent service file system namespace to not propagate further mounts from the main file system.
Comment 1 David Strauss 2012-10-20 05:20:54 UTC
This may actually be a case of something stopping the mount while the service is running with the service continuing to run. We're investigating.
Comment 2 Lennart Poettering 2013-01-15 01:06:52 UTC
Any update?
Comment 3 David Strauss 2013-01-15 07:16:51 UTC
I don't think we've seen this again, but I need to ask our ops team. I'll mark this NEEDINFO so it's off the main bug-tracking table for now.
Comment 4 Lennart Poettering 2014-02-21 17:32:10 UTC
CLosing since we haven't heard of this in a while.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.