From: Paul A Sand <pas@granite.unh.edu>
Subject: Re: best way to synch passwd file between 2 systems
Date: Mon, 12 Aug 2002 16:34:07 +0000 (UTC) [thread overview]
Message-ID: <slrnalforv.r9f.pas@granite.unh.edu> (raw)
In-Reply-To: aj8j60$18u9v9$1@ID-126742.news.dfncis.de
In article <aj8j60$18u9v9$1@ID-126742.news.dfncis.de>, 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 |
prev parent reply other threads:[~2002-08-12 16:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-12 15:10 best way to synch passwd file between 2 systems dJon'Z
2002-08-12 15:30 ` Marre des Spameurs qui prennent les add dans les news [SauroN]
2002-08-12 15:46 ` Brian Haley
2002-08-12 23:52 ` Nico Kadel-Garcia
2002-08-12 16:34 ` Paul A Sand [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox