]> 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)
committerJoshua Lock <josh@linux.intel.com>
Tue, 22 May 2012 05:13:48 +0000 (22:13 -0700)
commitfb9f5feaa49b78d03d25d96254a5ce04079ce594
tree361b68e860ac7de3cb5ebc236b8fb8f8c6d0bde9
parent8a8b1a49e3c7f96d76f6457a1f9a14e1eb4d5302
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]

(From OE-Core rev: 68c589f1b5ee36f0aff151b728447ffdae14622c)

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