From owner-freebsd-questions Wed Apr 9 21:06:49 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id VAA11944 for questions-outgoing; Wed, 9 Apr 1997 21:06:49 -0700 (PDT) Received: from obiwan.aceonline.com.au (obiwan.aceonline.com.au [203.103.90.67]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id VAA11930 for ; Wed, 9 Apr 1997 21:06:38 -0700 (PDT) Received: from localhost (adrian@localhost) by obiwan.aceonline.com.au (8.8.5/8.8.5) with SMTP id LAA02655; Thu, 10 Apr 1997 11:54:27 +0800 (WST) Date: Thu, 10 Apr 1997 11:54:25 +0800 (WST) From: Adrian Chadd To: Tim Tsai cc: dwhite@resnet.uoregon.edu, questions@freebsd.org Subject: Re: multi-user adduser In-Reply-To: <199704100321.WAA06433@shell.futuresouth.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I was about to say that :) The best way would be to write a script that took the relevant information, and appended it to a file (somewhere not world-readable:) Then every 5 minutes cron another script to run that goes though each line in the file, extracts the info, and runs adduser -batch per line. Then delete the file. :) Again, there might be some race problems (say youre about to add something or half way there when the script decides to add the users).. obviously a little thought is needed. Anyone? Or am I going to have to implement what I suggested (again? :) Cya -- Adrian Chadd | UNIX, MS-DOS and Windows ... | (also known as the Good, the bad and the | ugly..) On Wed, 9 Apr 1997, Tim Tsai wrote: > > > Does anybody have an adduser script that's multi-user compatible? We > > > need a script where our staff members can run it simultaneously without > > > worrying about UID conflicts, etc. > > > Editing the password file simultaneously is asking for trouble. I don't > > think it is possible, as one person will spam the changes another makes. > > Actually we just need to add users. Only one person (me) would edit > the password file. I looked at the code some last night and it doesn't > seem too bad. All we really need is to make sure the UID/GID is unique > which can be done via an external lock file. The rest of the program > already handles locking, etc. correctly. Is there anything else I am > missing? > > > You have too many people adduser'ing ;) > > Well, it's convenient to be able to add new users while we're on the > phone with them and check for problems. We add users at multiple > locations so having one person to do it all isn't very practical. > > Our billing software has an Unix interface that would call adduser as > a daemon, actually. Perhaps it's time for us to install that. > > Thanks, > > Tim >