diff options
author | Kai Kang <kai.kang@windriver.com> | 2016-02-29 17:19:32 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-20 23:12:27 +0000 |
commit | 57a525ca7271a8fe3913c61aa87cb0ba1674b4b2 (patch) | |
tree | 3ce9a1cdea084f0f063310c3f2441d52c62e8bb3 /meta/classes/useradd.bbclass | |
parent | 5d06f00471f9db89ea63bae1bc900fcdea5c6bf3 (diff) | |
download | poky-57a525ca7271a8fe3913c61aa87cb0ba1674b4b2.tar.gz |
useradd_base.bbclass: replace retry logic with flock
When perform useradd during populate sysroot, it locks files passwd.lock
and group.lock at same time. And then it meets a dead lock issue
randomly.
Use flock to reslove it by using an universal lock directory for all the
user and group related operations.
[YOCTO #9022]
(From OE-Core rev: 2ebf697b46c42cee8bfa6d2e6087397f8cce385c)
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/useradd.bbclass')
-rw-r--r-- | meta/classes/useradd.bbclass | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass index c960656f02..0a6f2be0d4 100644 --- a/meta/classes/useradd.bbclass +++ b/meta/classes/useradd.bbclass | |||
@@ -57,7 +57,7 @@ if test "x`echo $GROUPADD_PARAM | tr -d '[:space:]'`" != "x"; then | |||
57 | opts=`echo "$GROUPADD_PARAM" | cut -d ';' -f 1` | 57 | opts=`echo "$GROUPADD_PARAM" | cut -d ';' -f 1` |
58 | remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2-` | 58 | remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2-` |
59 | while test "x$opts" != "x"; do | 59 | while test "x$opts" != "x"; do |
60 | perform_groupadd "$SYSROOT" "$OPT $opts" 10 | 60 | perform_groupadd "$SYSROOT" "$OPT $opts" |
61 | if test "x$opts" = "x$remaining"; then | 61 | if test "x$opts" = "x$remaining"; then |
62 | break | 62 | break |
63 | fi | 63 | fi |
@@ -73,7 +73,7 @@ if test "x`echo $USERADD_PARAM | tr -d '[:space:]'`" != "x"; then | |||
73 | opts=`echo "$USERADD_PARAM" | cut -d ';' -f 1` | 73 | opts=`echo "$USERADD_PARAM" | cut -d ';' -f 1` |
74 | remaining=`echo "$USERADD_PARAM" | cut -d ';' -f 2-` | 74 | remaining=`echo "$USERADD_PARAM" | cut -d ';' -f 2-` |
75 | while test "x$opts" != "x"; do | 75 | while test "x$opts" != "x"; do |
76 | perform_useradd "$SYSROOT" "$OPT $opts" 10 | 76 | perform_useradd "$SYSROOT" "$OPT $opts" |
77 | if test "x$opts" = "x$remaining"; then | 77 | if test "x$opts" = "x$remaining"; then |
78 | break | 78 | break |
79 | fi | 79 | fi |
@@ -89,7 +89,7 @@ if test "x`echo $GROUPMEMS_PARAM | tr -d '[:space:]'`" != "x"; then | |||
89 | opts=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 1` | 89 | opts=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 1` |
90 | remaining=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 2-` | 90 | remaining=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 2-` |
91 | while test "x$opts" != "x"; do | 91 | while test "x$opts" != "x"; do |
92 | perform_groupmems "$SYSROOT" "$OPT $opts" 10 | 92 | perform_groupmems "$SYSROOT" "$OPT $opts" |
93 | if test "x$opts" = "x$remaining"; then | 93 | if test "x$opts" = "x$remaining"; then |
94 | break | 94 | break |
95 | fi | 95 | fi |