From: Randy MacLeod <randy.macleod@windriver.com>
To: <openembedded-core@lists.openembedded.org>,
"Huang, Jie (Jackie)" <Jackie.Huang@windriver.com>
Subject: Re: [PATCH 1/1] useradd.bbclass: use locking of bb.utils to avoid lock race issue of useradd/groupadd
Date: Sun, 22 Jul 2012 23:24:26 -0400 [thread overview]
Message-ID: <500CC3EA.2030000@windriver.com> (raw)
In-Reply-To: <500CAF3B.1020001@windriver.com>
On 12-07-22 09:56 PM, Randy MacLeod wrote:
> On 12-07-22 08:10 AM, Huang, j (Jackie) wrote:
>>
>>
>>> On Sun, 2012-07-22 at 14:53 +0800, jackie.huang@windriver.com wrote:
>>>> From: Jackie Huang <jackie.huang@windriver.com>
>>>>
>>>> A race condition can occur when adding users and groups to the
>>>> passwd and group files, in [YOCTO #1794], 10 times retry added
>>>> but it is not fixed completely.
>>>>
>>>> This fix re-writes the useradd_preinst and useradd_sysroot with
>>>> python and use locking of bb.utils to lock the passwd and group
>>>> files before executing useradd/groupadd commands to avoid the
>>>> lock race themselves.
>>>>
>>>> [YOCTO #2779]
>>>>
>>>> Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
>>>> ---
>>>> meta/classes/useradd.bbclass | 284
>>>> ++++++++++++++++++------------------------
>>>> 1 files changed, 124 insertions(+), 160 deletions(-)
>>>
>>> Please resend this with the whitespace issues resolved. Its near
>>> impossible to review as it stands :(
>>
>> Re-sent, sorry about that.
>
> Hi Jackie,
>
> I don't see that your new version sent at 8:01 is any better
> but I could be wrong...
>
> Robert,
> Please take a look and help Jackie with formatting
> and perhaps small single purpose commits as needed -
> i.e. separate the whitespace changes from the functional changes.
Summary:
Jackie did the right thing; I need to read more carefully. ;-)
// Randy
Details:
I've looked at the two emails more closely now and see the
white space problem lines and saw that Jackie did fix those up
in the new patch. Specifically:
-USERADDSETSCENEDEPS = "${MLPREFIX}base-passwd:do_populate_sy
+USERADDSETSCENEDEPS = "base-passwd:do_populate_sysroot_setsc
USERADDSETSCENEDEPS_virtclass-cross = ""
USERADDSETSCENEDEPS_virtclass-native = ""
USERADDSETSCENEDEPS_virtclass-nativesdk = ""
@@ -154,61 +118,61 @@ do_package_setscene[depends] = "${USERA
# Recipe parse-time sanity checks
def update_useradd_after_parse(d):
- useradd_packages = d.getVar('USERADD_PACKAGES', True)
+ useradd_packages = d.getVar('USERADD_PACKAGES', True)
- if not useradd_packages:
- raise bb.build.FuncFailed, "%s inherits useradd but
+ if not useradd_packages:
+ raise bb.build.FuncFailed, "%s inherits usera
- for pkg in useradd_packages.split():
- if not d.getVar('USERADD_PARAM_%s' % pkg, True) and
- raise bb.build.FuncFailed, "%s inherits useradd
+ for pkg in useradd_packages.split():
+ if not d.getVar('USERADD_PARAM_%s' % pkg, Tru
+ raise bb.build.FuncFailed, "%s inheri
python __anonymous() {
- update_useradd_after_parse(d)
+ update_useradd_after_parse(d)
}
Sorry for the noise.
// Randy
>
> This problem is happening frequently so I'd like to get this
> worked out upstream.
>
> Thanks,
> // Randy
>
>
>>
>> Thanks,
>> Jackie
>>
>>>
>>> Cheers,
>>>
>>> Richard
>>
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>>
>
>
--
# Randy MacLeod. MTS, Linux, Wind River
Direct: 613.963.1350
next prev parent reply other threads:[~2012-07-23 7:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-22 6:53 [PATCH 0/1] useradd.bbclass: use locking of bb.utils to avoid lock race issue of useradd/groupadd jackie.huang
2012-07-22 6:53 ` [PATCH 1/1] " jackie.huang
2012-07-22 8:36 ` Richard Purdie
2012-07-22 12:10 ` Huang, Jie (Jackie)
2012-07-23 1:56 ` Randy MacLeod
2012-07-23 3:24 ` Randy MacLeod [this message]
2012-07-23 10:09 ` Richard Purdie
2012-07-24 1:59 ` jhuang0
-- strict thread matches above, loose matches on Subject: below --
2012-07-22 12:01 [PATCH 0/1] " jackie.huang
2012-07-22 12:01 ` [PATCH 1/1] " jackie.huang
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=500CC3EA.2030000@windriver.com \
--to=randy.macleod@windriver.com \
--cc=Jackie.Huang@windriver.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.