Re: [Replicator-users] A look in "repli-update"
Status: Beta
Brought to you by:
schaumat
|
From: Jerome W. <jwa...@bx...> - 2002-10-29 22:41:08
|
Before anything else, tell me which version you are currently using.
Bernd Harmsen wrote:
>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.
>
>
You don't have to apologize, I probably make other mistakes.
I just wanted you to know so that you learn something.
:-)
>>I can help documenting the whole lot, but starting with repli-sync and
>>repli-update is a good idea, as I'll have to use them soon also, and
>>have recently put an eye on them.
>>
>>
>
>Ok, lets start with repli-update.
>
>
Ok, as it is the next tool I'll have to use.
>>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
>>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.
>
>
Replicator is truly a cool tool, working surprisingly well... when you
are able to fix the big bugs you find in it.
Hopefully, we will fix those very soon.
>>>What do you think the next step should be?
>>>
>>>
>>We should contact each other and discuss (on IRC) about the code (I know
>>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.
>
>
>
Well, let's forget it then.
>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.
>
>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
>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.
>
>
Ok, but you can also use an ip address, I think.
>--destdir
> Directorie-tree which content should be synchroniced with the model.
> During repli-sync this should be "/"
>
>
Ok
>--real
> Sets the variable $dryrun to "", else ist is $dryrun="--dry-run"
> which is an option to rsync.
>
>--dev
> Sets the variable $withdev=1 (true). This adds the string "/dev" to
> the list @slash_exclude bevor syncing the root-filesystem.
>
>--nousr
> Sets the variable $nousr=1 (true). (Default is 0 ?????). This
> completly skips the replication of the /usr-directory.
>
>--cfengine
> Sets variable $cfengine=1 (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=1 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.
>
>--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 $confile @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 = "/tmp/excl.rsync.$$";
>$fh = new FileHandle $excludefile,"w" or die "opening exclude file:$!\n";;
>foreach (@slash_exclude) { print $fh "- $_\n"; }
>$fh->close;
>dosystem("rsync $rsyncopt --one-file-system --exclude-from=$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 = '';
>foreach (@usr_exclude) { $usr_exclude .= " --exclude '- $_' "; }
>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}::replicator/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?
>
>
No, I don't, but we may ask, and I'll probably get it.
>- 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.
>
>
I don't understand.
>- 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.
>
>
I did notice this too.
>
>- More ideas ?
>
>
Yes, a lot.
Sadly, I don't have access today to the machine were my replicator has
been modified. I cannot tell much more today, and probably this week.
>
>Enough for today.
>What du you think about that?
>
>
Tell me the exact version you are using before anything else.
>Regards,
>Bernd
>
>
|