From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by mail.openembedded.org (Postfix) with ESMTP id 1ED396057B for ; Wed, 17 Feb 2016 05:40:28 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.15.2/8.15.1) with ESMTPS id u1H5eSxj016260 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 16 Feb 2016 21:40:29 -0800 (PST) Received: from [128.224.162.231] (128.224.162.231) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.3.248.2; Tue, 16 Feb 2016 21:40:28 -0800 To: "Burton, Ross" References: From: Kang Kai Message-ID: <56C407CB.4060100@windriver.com> Date: Wed, 17 Feb 2016 13:40:27 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Cc: OE-core Subject: Re: [PATCH 1/1] useradd_base.bbclass: fix simultaneous with flock X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2016 05:40:29 -0000 Content-Type: multipart/alternative; boundary="------------090904020105080700040102" --------------090904020105080700040102 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit On 2016年02月16日 20:09, Burton, Ross wrote: > > On 16 February 2016 at 07:14, > wrote: > > +FLOCK_FILE=$SYSROOT/etc > > > useradd_base is also used by extrausers.bbclass, so it would be best > if useradd_base decided where to use as a lock ($rootdir/${sysconfdir} > sounds sensible) instead of expecting that the caller sets FLOCK_FILE > and mysteriously failing if it wasn't set. OK. Sounds good. > > Also if we're locking and waiting properly instead of using timeouts > and loops, can we remove the "does it exist?" check before the > operation (eg groupadd -f will exit 0 if the group exists) and after > (with proper locking that shouldn't be happening). I prefer to keep such check. There is more than one case that causes operation error such as pass wrong parameters. The messages are helpful for developers. Thanks, Kai > > Ross -- Regards, Neil | Kai Kang --------------090904020105080700040102 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 8bit
On 2016年02月16日 20:09, Burton, Ross wrote:

On 16 February 2016 at 07:14, <kai.kang@windriver.com> wrote:
+FLOCK_FILE=$SYSROOT/etc

useradd_base is also used by extrausers.bbclass, so it would be best if useradd_base decided where to use as a lock ($rootdir/${sysconfdir} sounds sensible) instead of expecting that the caller sets FLOCK_FILE and mysteriously failing if it wasn't set.

OK. Sounds good.


Also if we're locking and waiting properly instead of using timeouts and loops, can we remove the "does it exist?" check before the operation (eg groupadd -f will exit 0 if the group exists) and after (with proper locking that shouldn't be happening).

I prefer to keep such check. There is more than one case that causes operation error such as pass wrong parameters. The messages are  helpful for developers.

Thanks,
Kai


Ross


-- 
Regards,
Neil | Kai Kang
--------------090904020105080700040102--