From: <ar...@sy...> - 2007-10-30 21:10:55
|
Author: arighi Date: 2007-10-30 16:10:44 -0500 (Tue, 30 Oct 2007) New Revision: 4315 Modified: trunk/etc/autoinstallscript.template trunk/sbin/si_pcp trunk/sbin/si_updateclient Log: -fix: turn off the rsync quick checks when distributing overrides Normally rsync will skip any files that are already the same size and have the same modification timestamp. This can be a problem when multiple overrides are distributed at the same time and there are more files with the same name, same size and same timestamp (but different content) in the overrides and in the image. Under this rare (but potential) conditions a file is not correctly distributed to the target clients. Typically this can happen when you have a script on the image server that creates the same file name in multiple overrides and these files are different, but have the same size (this can be quite common with configuration files that must be distributed to different client sets). The problem can be resolved adding the option "-I" to rsync only when distributing overrides, in order to ignore the "name + size + timstamp" check and enforce to always compare the content of the files. The only drawback of this approach is a very small performance reduction when the overrides are distributed to a running system (by si_pushoverrides or si_updateclient), but it can resolve some troublesome issues. Modified: trunk/etc/autoinstallscript.template =================================================================== --- trunk/etc/autoinstallscript.template 2007-10-29 15:27:45 UTC (rev 4314) +++ trunk/etc/autoinstallscript.template 2007-10-30 21:10:44 UTC (rev 4315) @@ -376,7 +376,7 @@ else # Use rsync logmsg "trying to download override ${OVERRIDE} with rsync..." - logmsg "rsync -av --numeric-ids $IMAGESERVER::overrides/$OVERRIDE/ /a/" + logmsg "rsync -aIv --numeric-ids $IMAGESERVER::overrides/$OVERRIDE/ /a/" rsync -av --numeric-ids $IMAGESERVER::overrides/$OVERRIDE/ /a/ > /dev/console || logmsg "Override directory $OVERRIDE doesn't seem to exist, but that may be OK." fi unset bittorrent_tarball Modified: trunk/sbin/si_pcp =================================================================== --- trunk/sbin/si_pcp 2007-10-29 15:27:45 UTC (rev 4314) +++ trunk/sbin/si_pcp 2007-10-30 21:10:44 UTC (rev 4315) @@ -145,7 +145,7 @@ # Use the following ssh options. my $ssh_opts = "-x -o BatchMode=yes -l $ssh_user"; -my $rsync_opts = "-aHSz$verbose $dry_run --numeric-ids --timeout=$timeout --rsh='ssh $ssh_opts'"; +my $rsync_opts = "-aHISz$verbose $dry_run --numeric-ids --timeout=$timeout --rsh='ssh $ssh_opts'"; # Main program. @hosts = map { $_ .= ":$target" } @hosts; Modified: trunk/sbin/si_updateclient =================================================================== --- trunk/sbin/si_updateclient 2007-10-29 15:27:45 UTC (rev 4314) +++ trunk/sbin/si_updateclient 2007-10-30 21:10:44 UTC (rev 4315) @@ -581,7 +581,7 @@ else { $module = "overrides/$module"; } - $cmd = "rsync -av --numeric-ids $delete $cmdopts rsync://${server}:${port}/${module}${directory} ${directory}"; + $cmd = "rsync -aIv --numeric-ids $delete $cmdopts rsync://${server}:${port}/${module}${directory} ${directory}"; # execute command if ($dry_run) { |