different uids and gids for new users on 2 different servers

Hi, I have 2 installations with virtualmin pro on 2 different servers. Based on virtualmin extended features and various bash scripts I manage to have each one as a backup for the other in case of failure, keeping all domains in sync in both servers, and selecting by dns which one will serve.

I am running such a configuration for 2 years but now as domains are increasing I have the following problem.

If a new domain user or a mail user is created on the 1st server let's say with uid=1067 and gid=1050, I will backup and then restore the domain on the 2nd server keeping the same uid, gid

However If in the meantime a new domain user or mail user is created on the 2nd server before I do the restore of the domain there, it will get the same uid, and gid, preventing me to restore the domain.

Do you think it would be possible to add an option on virtualmin for new users, only for the case when virtualmin selects a new uid (meaning not when restoring with --no-reuid option) to have :

1) uids and gids always an odd or even number? (like the way mysql is handling replication issues with autonumbering)

or 2) specifically set the range of the new uids and gids. (I could then set for example (20000-39999) to one server and (40000-59999) to the other. /etc/adduser.conf and /etc/login.defs have such variables if you think they could be used.)

I am really stuck with this replication issue. Anything you can do on this one will be greatly appreciated!

Thanks!

Status: 
Closed (fixed)

Comments

So do you mean that you would like Virtualmin to only select a new UID or GID when the one specified in the backup clashes with an existing user? That isn't supported yet, but certainly could be implemented ..

Alternately, you can control the range used for ID allocation - this is set at Webmin -> System -> Users and Groups -> Module Config -> New user options. Does that solve the issue for you?

No need for my situation to select a new UID or GID when the one specified in the backup clashes with an existing user. If such a problem occures I prefer aborting with an error.

The range used for ID allocation in the Module Config of Users and Groups is indeed what I need. I wasn't aware of this and I was impressed of the number of options it has!

I set up different ranges on each server and tested with creation of users on both before trying to restore the domains and this setting does avoid same uids and gids.

Thank you very much for your quick response!

Great, glad that worked for you!

Automatically closed -- issue fixed for 2 weeks with no activity.