Comment 7 for bug 811823

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 811823] Re: idmapd upstart job ends in an inconsistent state if /usr is a separate partition

Hi Steve,

On Thu, Sep 08, 2011 at 09:12:53PM -0000, Steve Atwell wrote:
> Steve, I'm looking at your change to gssd.conf and idmapd.conf, and it
> looks like you've got a race condition. You add the following to the
> pre-start script of both:

> if ! mountpoint -q "$PIPEFS_MOUNTPOINT"
> then
> mount -t rpc_pipefs rpc_pipefs "$PIPEFS_MOUNTPOINT"
> fi

> The problem is that the filesystem could get mounted between when you
> check with mountpoint and when you call mount. And because mount is the
> last command in the pre-start script, if it fails then the pre-start
> will fail, preventing the job from starting. I haven't actually seen
> this issue, but since two jobs are running this same code around the
> same time, it definitely seems like a possibility.

> Probably a simple "|| true" on the mount command would be sufficient.
> If the mountpoint isn't actually there when rpc.gssd or rpc.idmapd
> starts, that process will exit and upstart will retry.

You're right that this is not atomic; however, I believe the worst-case
scenario is that the kernel fs will be mounted twice at the same mount
point, which should not cause significant problems. (I have seen this
outcome in practice on my machine while testing.)

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>