Koozali.org: home of the SME Server

Synching user names and accounts between e-smith servers

DJ_Ramjet99

Synching user names and accounts between e-smith servers
« on: January 08, 2002, 01:50:24 AM »
Hi,

Have managed to wrangle another box to use as a server onto which I have installed Beta 5.1.3-all seems cool bananas.
What I want to do is to sync the user names and passwords from my production server (4.1.2 with updated samba) to my test box.
Both are on the same network (192.168.1.1 and 192.168.1.12) and both appear in my Windows workgroup.
Initally I could not see any i-bays on the 'slave' box until I ran (on the slave box) the commands:

rsync –av –e ssh root@:/etc/passwd /etc/passwd
rsync –av –e ssh root@:/etc/smbpasswd /etc/smbpasswd

Once I had done this, I was able to see the test i-bay I had created, but whenever I try to access it, I get the error message "Sharename not found, be sure you typed it correctly"
On both boxes, if i type id (username) I get identical uid and gids for users so that looks OK as well, so at least the users are copied across properly. Checking the /etc/passwds and /etc/smbpasswds files verify this.

But the users do not appear in the slaves server manager and nor do the groups they are allocated from the master.

Any ideas ?

DJ_Ramjet99

Re: Synching user names and accounts between e-smith servers
« Reply #1 on: January 08, 2002, 01:54:58 AM »
Hold the phone...permissions for smbpasswd are root:root rw - - on the master and admin:root rw - - on the slave. Lets try rearranging that a little and rebooting the slave and this box

DJ_Ramjet99

Re: Synching user names and accounts between e-smith servers
« Reply #2 on: January 08, 2002, 01:59:56 AM »
OK, that didnt work and now sldap wont start.

Any ideas ? I am not keen on using NIS to do this, would prefer a simple CRON job.

Greg Zartman

Re: Synching user names and accounts between e-smith servers
« Reply #3 on: January 08, 2002, 03:01:56 AM »
DJ,

Don't forget the e-smith/SME user database (/home/e-smith/accounts).  Looks to me like you are only rsyncing the standard Linux stuff over.

I'm not completely fluent with the e-smith/sme setup so you may want to do more inquiry on the topic.  

Regards,

Greg Zartman

DJ_Ramjet99

Re: Synching user names and accounts between e-smith servers
« Reply #4 on: January 08, 2002, 03:21:36 AM »
Cheers Greg, gave that a go and it did copy over the user accounts correclty (now appear in the manager) but I have lost samba access to the original i-bay on the server (it is still there through command line) and appear to have copied over the i-bays from my master server (albeit without their contents) so looks as if I have overwritten the smb config. Still get no access to these.

Not worried as this is a test box only so will fiddle around some more.

Greg Zartman

Re: Synching user names and accounts between e-smith servers
« Reply #5 on: January 08, 2002, 03:44:54 AM »
I don't think you'll be able to setup a true failover server with Samba as it doesn't sync will with other Samba servers  

I would think that the best way to do this would be to have a seperate smb.conf on the backup machine that looked to the main samba server for authentication.  If you have your network setup as a domain, then you'll need to make the backup machine a member of the domain (i.e., create a machine account for the backup server on the main server and then join the backup machine to the domain using the smbpasswd command).

Good luck.

Greg

DJ_Ramjet99

Re: Synching user names and accounts between e-smith servers
« Reply #6 on: January 08, 2002, 03:52:53 AM »
OK have discovered that the home/e-smith/accounts file includes the ibays as well so that is why they are copied over.

Tried editing the functions/groups file to create an additional file for copying/updating that would only include user and group information but no luck there (perl not good enough)

Anyone on devifo have a better idea as to how to do this ? It would be a very useful feature to have.

Judy Morgann

Re: Synching user names and accounts between e-smith servers
« Reply #7 on: January 09, 2002, 10:19:14 PM »
Hi,

i wonder why this isn´t a feature of e-smith? Syncing users between two or more servers is an important need. I can´t believe that all using e-smith server in a real production environment rely on one box...if it fails :(
I try the same like you creating a "failsafe e-smith cluster" with 3 server. heartbeat and piranha are very good tools to take over the ip and all services if one server dies. but the big problem is that i can´t find a way to syncronise the useraccounts.
would be very nice if the developers could help. i think it would be a good selling arguement if e-smith servers are failsave.

greetings
judy

Scott

Re: Synching user names and accounts between e-smith servers
« Reply #8 on: September 05, 2003, 03:50:54 AM »
HI,

I'm not a developer or very techy into this yet.
Why not try using the sme backup system
to sync the servers?

In server-manager there is a Backup restore panel.
If you could use perl or some other script to activate
this from your backup server it would produce a
tar.gz file. Then all you would need to do is do a
restore to the backup server.

This is not an practical way of doing a sync.
But it may work until a real techy can devise
a proper sync.

Have you tried rsync?

Another possibility would be to sync the regular
configuration ffiles to the template-custom directory
of the backup server. This would cause the backup
server to boot with all of the parameters of the main
server. Secondly, you may need to rsync the individual
ibays in order to copy the contents of them to
the backup server.

Another possibility is to figure out what sme uses to
maintain the file integrity of the main system files.
The template model that sme uses prevents you
from editing them directly, as on reboot the files
are restored to their previouse values unless they
are updated properly. Thus, if there is a database
file that sme uses to maintain the system integrity,
syncing the database files on the two servers would
then cause a proper configuring of the backup
server as you would like.

I'm providing theories here, they could be right
they could be wrong. I'm to knew to tell you
how to implement them.

Scott