Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 0/2] Two useradd fixes
Date: Fri, 23 Mar 2012 12:04:08 +0000	[thread overview]
Message-ID: <1332504248.9740.393.camel@ted> (raw)
In-Reply-To: <cover.1332453478.git.scott.a.garman@intel.com>

On Thu, 2012-03-22 at 21:43 -0700, Scott Garman wrote:
> Hello,
> 
> This pull request fixes two race conditions related to the useradd code.
> 
> Yocto bug #2127 describes how when using the RPM package manager, the
> order of package installation during generatin of the rootfs did not
> guarantee that base-passwd and shadow would be installed before other
> packages which need to install custom users/groups in their postinstall
> functions. This fix ensures that when base-passwd and/or shadow are
> part of an image, they will be installed first during image generation.
> 
> The second race condition is described in Yocto bug #1794, and can occur
> if two build steps try to update the sysroot passwd/group files at the
> same time. Since the shadow utilities enforce file locking, the commands
> will fail to run. The fix for this involves checking for failure and
> retrying the commands up to 10 times, with a 1s delay between attempts
> before giving up.
> 
> Verifying these fixes involved creating numerous images and useradd-based
> packages repeatedly on a build host with high parallelism, and also doing
> so from a pre-populated sstate-cache. I was able to reliably simulate the
> file locking behavior by making the passwd/group files read only when
> developing the fix for #1794. 
> 
> Scott
> 
> The following changes since commit 87e581bb7da9f1530d190cd023fcf892c8b858f5:
> 
>   ddimage: Add script for writing images to boot media (2012-03-22 19:17:54 +0000)
> 
> are available in the git repository at:
>   git://git.pokylinux.org/poky-contrib sgarman/useradd-lock-fix-oe
>   http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=sgarman/useradd-lock-fix-oe
> 
> Scott Garman (2):
>   package_rpm.bbclass: ensure base-passwd and shadow get installed
>     first
>   useradd.bbclass: retry useradd/groupadd commands to avoid lock race
>     issues

Merged to master, thanks!

Richard




      parent reply	other threads:[~2012-03-23 12:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-23  4:43 [PATCH 0/2] Two useradd fixes Scott Garman
2012-03-23  4:43 ` [PATCH 1/2] package_rpm.bbclass: ensure base-passwd and shadow get installed first Scott Garman
2012-03-23  4:43 ` [PATCH 2/2] useradd.bbclass: retry useradd/groupadd commands to avoid lock race issues Scott Garman
2012-03-23 21:12   ` McClintock Matthew-B29882
2012-03-23 12:04 ` Richard Purdie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1332504248.9740.393.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox