Title: Re: [Sisuite-devel] BitTorrent transport + si_monitortk
Talk about quick fixes :-)
 
Thanks Andrea.
 
Cheers,
 
Bernard


From: Andrea Righi [mailto:[EMAIL PROTECTED]
Sent: Wed 24/05/2006 01:27
To: Bernard Li
Cc: [email protected]
Subject: Re: [Sisuite-devel] BitTorrent transport + si_monitortk

Fixed. That's because during the bittorrent startup some temporary files
are created on the filesystems and then removed. So the evaluated speed
and the status resulted a negative value.

Cheers,
-Andrea

-------- Original Message --------
Subject: [systemimager-commits] r3585 - trunk/initrd_source/skel/etc/init.d
Date: Wed, 24 May 2006 03:24:36 -0500
From: Andrea Righi <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [EMAIL PROTECTED]

Author: arighi
Date: 2006-05-24 03:24:36 -0500 (Wed, 24 May 2006)
New Revision: 3585

Modified:
   trunk/initrd_source/skel/etc/init.d/functions
Log:
fix: do not report negative values for speed and status

Modified: trunk/initrd_source/skel/etc/init.d/functions
===================================================================
--- trunk/initrd_source/skel/etc/init.d/functions       2006-05-23 22:01:34
UTC (rev 3584)
+++ trunk/initrd_source/skel/etc/init.d/functions       2006-05-24 08:24:36
UTC (rev 3585)
@@ -1568,11 +1568,12 @@

         # Evaluate bandwidth.
         speed=`echo "scale=2; (($TOT - $DISKSIZE) - $CURR_SIZE) /
$REPORT_INTERVAL" | bc`
+        speed=`echo "scale=2; if ($speed >= 0) { print $speed; } else {
print 0; }" | bc`

         # Evaluate status.
         CURR_SIZE=$(($TOT - $DISKSIZE))
         status=`echo "scale=2; $CURR_SIZE * 100 / $IMAGESIZE" | bc`
-        if [ `echo "scale=2; $status == 0" | bc` -eq 1 ]; then
+        if [ `echo "scale=2; $status <= 0" | bc` -eq 1 ]; then
             status=1
         elif [ `echo "scale=2; $status >= 100" | bc` -eq 1 ]; then
             status=99


Bernard Li wrote:
> Just now I was imaging a node with BitTorrent transport and for a split
> second (between initialization and imaging) I thought I saw the red
> "Installation failed" icon.

> Just FYI, might want to keep an eye out for it next time you test.

> Cheers,

> Bernard

Reply via email to