From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,f36c62fdc1237efa X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2002-08-12 09:34:08 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!news-out.visi.com!hermes.visi.com!nntp1.roc.gblx.net!nntp.gblx.net!nntp.gblx.net!news.unh.edu!not-for-mail From: Paul A Sand Newsgroups: comp.unix.tru64 Subject: Re: best way to synch passwd file between 2 systems Date: Mon, 12 Aug 2002 16:34:07 +0000 (UTC) Organization: University of New Hampshire Message-ID: References: NNTP-Posting-Host: granite.unh.edu X-Trace: tabloid.unh.edu 1029170047 31830 132.177.137.16 (12 Aug 2002 16:34:07 GMT) X-Complaints-To: usenet@tabloid.unh.edu NNTP-Posting-Date: Mon, 12 Aug 2002 16:34:07 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.unix.tru64:8374 In article , dJon'Z wrote: > I've just set up a TruCluster v1.6 on two Tru64 4.0g boxes. Since I've got > two separate systems with two /etc/passwd files to maintain, I want to > regularly synch the two files. > > My thought is to run a cron script daily, use rsh and rcp to check which > version is newer, and copy that version to the second system. You might want to check using ssh/scp instead. > It's not foolproof, but I'm not worried if the cluster switches hosts since > I'll know that. I may have an id or two that in not synched due to the > timing of the file copy, but that is a very minor issue. > > My question is: can I copy the password file without a problem? I know I > should use vipw to edit the file and have it maintained, which got me > wondering if I could overlay the /etc/passwd file or do I need to do > something special? I'd recommend doing something special. Think about crashes (on either system) during the copy. Or an accidently-filled root filesystem on the copied-to system. You want to make the switchover from old to new versions of the file as atomic as possible, I think. Here's what we do: copy the new file to /etc/passwd.NEW link this to /etc/ptmp (this should lock the existing passwd file) unlink /etc/passwd.OLD (if it exists) link /etc/passwd to /etc/passwd.OLD rename /etc/ptmp to /etc/passwd run /usr/sbin/mkpasswd on /etc/passwd You probably should check each step for errors and bail if you detect any. As another poster pointed out, NIS is an option. [We did the above after giving up on NIS, though.] -- -- Paul A. Sand | Anything worth doing well -- University of New Hampshire | is worth doing slowly. -- pas@unh.edu | (Gypsy Rose Lee) -- http://pubpages.unh.edu/~pas |