]> code.ossystems Code Review - openembedded-core.git/commit
useradd.bbclass: retry useradd/groupadd commands to avoid lock race issues
authorScott Garman <scott.a.garman@intel.com>
Fri, 23 Mar 2012 04:43:42 +0000 (21:43 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 23 Mar 2012 12:03:31 +0000 (12:03 +0000)
commit68c589f1b5ee36f0aff151b728447ffdae14622c
tree40efb5b558e40ed7224654784aca7d5b30b26e23
parent3d2d3cb379608301b17ce57787d324c2f06bf4f9
useradd.bbclass: retry useradd/groupadd commands to avoid lock race issues

A race condition can occur when adding users and groups to the
passwd and group files, causing errors like the following:

 ERROR: Function 'useradd_sysroot' failed
 Tried to access "/etc/group" but this was locked.

This fix will cause the useradd code to retry the useradd and
groupadd commands up to 10 times (with a 1s sleep in between
attempts) before failing.

This fixes [YOCTO #1794]

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/useradd.bbclass