From owner-freebsd-questions Thu May 2 11:37:10 2002 Delivered-To: freebsd-questions@freebsd.org Received: from buffnet4.buffnet.net (buffnet4.buffnet.net [205.246.19.13]) by hub.freebsd.org (Postfix) with ESMTP id 7EF1A37B41A for ; Thu, 2 May 2002 11:36:48 -0700 (PDT) Received: from buffnet11.buffnet.net (buffnet11.buffnet.net [205.246.19.55]) by buffnet4.buffnet.net (8.9.3/8.8.7) with ESMTP id OAA10838; Thu, 2 May 2002 14:36:53 -0400 (EDT) (envelope-from shovey@buffnet.net) Date: Thu, 2 May 2002 14:36:41 -0400 (EDT) From: Stephen Hovey To: "Geoffrey C. Speicher" Cc: freebsd-questions@FreeBSD.ORG Subject: Re: concurrent pw(8) corrupts master.passwd sometimes? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I think with the yp stuff it was the script for pushing out the maps - it would call pwd_mkdb or whatever and could sometimes do so concurrently and chew the works - SCO's did the same thing. So I just modified the script file to check for a certain file - if it exits, abort, if it doesnt exit, create it and continue ending in the removal of said file. Nothing fancy - but enough to keep my password files in 1 piece! :) On Thu, 2 May 2002, Geoffrey C. Speicher wrote: > On Thu, 2 May 2002, Stephen Hovey wrote: > > > I had trouble like this with the YP stuff - if two people changed their > > passwords or something at the same time, etc. > > > > I put my own locking in so that if something is in process it doesnt even > > try to run. > > How much code do pw and the YP utils use in common? > > This is an excerpt from the BUGS section of pw(8): > > There are the obvious races with multiple people running pwd_mkdb on dif- > ferent password files at the same time. The front-ends to pwd_mkdb, > chpass(1), passwd(1) and vipw(8), handle the locking necessary to avoid > this problem. > > Isn't pw(8) conspicuously missing from that list? > > > if it were me - I would change the method to create a file of pw commands, > > that a cronjob checks for an executes evern so many minutes IF a lockfile > > doesnt exit (so worst case it takes an extra 5 minutes before an account > > is created). > > Good idea. It may come to that if I can't fix it the right way. > > Geoff > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message