[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: how to check uniqueness of uidNumber ?



On Wed, 2003-01-15 at 05:50, Sameh Attia wrote:
> David Smith wrote:
> 
> >I am administering a system similar to yours. We built a Postgres
> >database just to maintain a list of available uidNumbers, and it has
> >worked quite well thus far. Every time we create a new user, we select a
> >uidNumber for the Postgres DB and remove it from the list.
> >
> >--Dave
> >  
> >
> what if we use a timestamp, pid, ..etc any combination of numbers we r 
> sure that they r unique? and also take into consideration the multiuser env.

Here's how we solve the locking problems:

We serialize all LDAP account creations through a single cron script (in PHP)
that is responsible for building each account. This may be considered an
over-complication, but it has worked very well, and a single point-of-entry
has proved very stable and reliable. Since OpenLDAP is optimized for reading,
not writing, we had some major problems allowing ad-hoc account creation.

When a a new user requests an account:

We add an entry to a Postgres table for pending account creations. Our cron
script (mentioned above) runs through that table and extracts outstanding
account creations. It then creates the user in LDAP and performs some
quota and housekeeping functions. The result: linear account creation,
no locking necessary, easy logs, easy maintenance.

--Dave