[Replicator-users] A look in "repli-update"
Status: Beta
Brought to you by:
schaumat
|
From: Bernd H. <bj...@da...> - 2002-10-29 00:04:14
|
Hello Jerome,
On Sat, Oct 26, 2002 at 09:04:28PM +0200, Jerome Warnier wrote:
> >At first I feel, that there is less concept or less (detailed)
> You do not mean "less", but "not much".
Ok, my english is not the best.
> I can help documenting the whole lot, but starting with repli-sync and=20
> repli-update is a good idea, as I'll have to use them soon also, and=20
> have recently put an eye on them.
Ok, lets start with repli-update.
> Sadly, I'm not someone who makes things by itself, I always need a reason.
> The maintainers are good-willing, off course, but have other things to=20
> do right now, as I understood.
Ok, I hope, that there is at leat a bit more of dokumentation
afterwards, to make it easier for other people to work on or use
replicator.
> >What do you think the next step should be?
> We should contact each other and discuss (on IRC) about the code (I know=
=20
> it enough to reply to common questions).
I have never used IRC and I'm not shure if I will like it. I like using
a dictionarie wenn writing english texts and this slow down my
typespeed very much.
I, think we should do the following things next. (No matter, how we
communicate). I already started a bit.
--------------------------------------------------------------------
1) Write a short overview of how "repli-update" should work.
--------------------------------------------------------------------
1. root-filesystem without @slash_exclude
It replicates the root (/) filesystem except for what is mentioned in
@slash_exclude. If you use cfengine, replicator parses
/etc/cfengine/cfengine.conf and does not copy files handled by cfengine
copying facility.=20
2. /usr-directory without @usr_exclude
It replicates the /usr directory (not the filesystem) except for what
is mentioned in @usr_exclude. Be aware that it may cross filesytems to
acheive this.
3. /var structure and files mentioned in @var_include=20
It replicates the directories structure of /var (only directories, no
files). It replicates the contents of the /var subdirectories mentioned
in @var_include.
This meschanism should be the same, no matter if repli-update is called
from repli-install or repli-sync
--------------------------------------------------------------------
2) Write a list of the Param "repli-update" understands and what they
should do.
--------------------------------------------------------------------
Because the first replication is working for me with repli-install but
not with repli-sync, and repli-sync uses other params to call
repli-update then repli-install, maybe there is a fault.
Correct me if I'm wrong, please.
--model <masterdir>
Name of the Modell host, e.g. DNS-Name. No directory.
--destdir
Directorie-tree which content should be synchroniced with the model.
During repli-sync this should be "/"
--real
Sets the variable $dryrun to "", else ist is $dryrun=3D"--dry-run"
which is an option to rsync.
--dev
Sets the variable $withdev=3D1 (true). This adds the string "/dev" to
the list @slash_exclude bevor syncing the root-filesystem.
--nousr
Sets the variable $nousr=3D1 (true). (Default is 0 ?????). This
completly skips the replication of the /usr-directory.
--cfengine
Sets variable $cfengine=3D1 (true). Bevor the sync of / the config from
cfengine is copied from the model. Using the local cfengine all files
handled by this tool are extracted and added to the list @slash_exclude
--noboot
Sets $noboot=3D1 and skips a separately rsync for the /boot-directory.
This rsync-run is necessary if /boot is as usual a own partition,
because repli-update only syncs the root-filesystem, not the
directory. (/boot is in the default @slash_exclude list to.)
-e
Get the cfengine configuration from the model using ssh and scp
instead of rsh and rcp.
--exclude
Adds the argument to the @slash_exclude list.
--usr_exclude
Adds the armunet to the @usr_exclude list.
=20
--config
Additional reads the given file. Can be used to set additional
variables and override settings in /etc/replicator/replicator.conf,
which is alway loaded first by repli-common.
repli-install calls:
repli-update --config $confile $ssh_opt --dev $rupdate_dry $netcopy_exclude=
--model $model --destdir $installtarget
But I don't know, what is in the variables at that time.
repli-sync calls:
$share_dir_on_server/repli-update --destdir / --model $model --config $conf=
ile @ARGV
$confile is "/etc/replicator/repli-sync" on the replicated host and
$model ist taken from that file.
Why these calls behave different ?
--------------------------------------------------------------------
3) Take a deeper look in the code of "repli-update" and understand
what is doing what.
--------------------------------------------------------------------
rsync is startet with different params during repli-update. I don't
understand some things, maybe because of my perl knowledge. Can you
help me ?
dosystem("rsync $rsyncopt ${model}::replicator/boot/ $destdir/boot/. 2>&1");
Clear.
$excludefile =3D "/tmp/excl.rsync.$$";
$fh =3D new FileHandle $excludefile,"w" or die "opening exclude file:$!\n";;
foreach (@slash_exclude) { print $fh "- $_\n"; }
$fh->close; =20
dosystem("rsync $rsyncopt --one-file-system --exclude-from=3D$excludefile $=
{model}::replicator/ $destdir 2>&1");
The content of the list @slash_exclude is written to a file, line by
line. But for what is the "-" in { print $fh "- $_\n"; } ?
my $usr_exclude =3D '';
foreach (@usr_exclude) { $usr_exclude .=3D " --exclude '- $_' "; } =20
dosystem("rsync $rsyncopt $usr_exclude ${model}::replicator/usr/. $destdir=
/usr/. 2>&1");
Interesting in how many different way a list can be passed to rsync. Is
there a matter for the different ways? I have somewhere heard about a
maximum length of the command line. Do you know how long a command line
can be?
$dryrun or -d "$destdir/var/." or mkdir "$destdir/var",0755 or die "cannot =
make $destdir/var";;
dosystem("rsync $rsyncopt --include '+ */' --exclude '- *' ${model}::repli=
cator/var/. $destdir/var/.");
foreach (@var_include) {
dosystem("rsync $rsyncopt ${model}::replicator/var/$_/ $destdir/var/$_ 2>&1=
");
}
For what is the "+" and the "-" sign in the [ei][xn]clude-rules? Is ist
perl-syntax or parsed by rsync?
What more?
--------------------------------------------------------------------
4) Correct "repli-update" and/or call it with other params
--------------------------------------------------------------------
- Do you have write access to the CVS-repository?
- What do you think about a @change_hostname list with files in which
the name of the model should be replaced with the name of the target
host. This can be implemented in repli-update or the example
repli-postint.
=20
- The config files replicator.conf and update_rules are not copied to
the target during repli-install bacause of the default
@shlash_exclude list. If we need them for repli.sync we should remove
/etc/replicator from this list.
=20
- More ideas ?
=20
=20
Enough for today.
What du you think about that?
Regards,
Bernd
|