[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Question on locking of useradd instances.



On Mon, Jun 04, 2001 at 09:30:20AM -0700, Harry Putnam wrote:
> "A. Konstam" <akonstam trinity edu> writes:
> 
> > Has anyone come up against and solved this problem. We have a
> > network of computers where a user can add an account for
> > himself on the linux server through Windows and Samba.
> > 
> > Now the problem is that sometimes multiple students (users) try
> > to add their accounts at the same time. We would like the
> > script that adds users to be able to lock out other instances
> > of itself when this race condition occurs. 
> > 
> > Has any one done this already or has some hints on the easiest
> > way to do it? If you would be willing to share your solution
> > that would be great.
> 
> Hope I haven't missed what the problem is.  From above I understand
> the accounts are generated on a single machine.  If that is the case
> wouldn't a test of ps output that didn't include the current users id
> but looked for the script running, do the trick:
> 
The adduser script is always run by root. So all the instances
of the running of the script are run by the same user.

I think we may be able to solve this problem using: lockfile
-- 
-------------------------------------------
Aaron Konstam
Computer Science
Trinity University
715 Stadium Dr.
San Antonio, TX 78212-7200

telephone: (210)-999-7484
email:akonstam trinity edu





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]