Andrea Mennucci <[EMAIL PROTECTED]> wrote:

 >   This message is in MIME format.

  Yuk - as this was normal text, this wasn't necessary.

 > this script takes as its argument  the file README.mirrors
 >  (that can be downloaded from the debian ftp sites), extracts the list
 > of hosts and pings them all (it takes roughly 30 seconds, since
 > it parallelizes) then sorts the output by fastest time

  I had some trouble running your script, because `ulimit -u` was set at
my system to 32 (for whatever reason), and I ran it under X - so I got
lots of "fork: try again" messages.  They seemed to prevent your
script from terminating normally.  Not knowing (then) how to solve the
maximum processes problem, I tried to change your script so it would
be configurable how many pings could run in parallel.

I added

  MAX_PINGS=5

to the top, and changed:

  # we do not want to flood the net; we test 30 sites at a time
  # then we wait 8 seconds so that most of the pings will be done
  if [ `expr $n % 30 ` = 0 ] ; then sleep 8 ; fi

to:

   while [ `ps -axu | grep -v grep | grep ping | wc --lines` -gt $MAX_PINGS ]
   do
     sleep 1
   done

This seems to limit the number of pings while not waiting longer than
necessary.  (Please note that I'm not good at shell scripts; there may
be a much better way to do this - it just worked for me).

 > I think it would be fantastic if this script could be made
 > part of   dpkg-ftp , (lets say, as an option when in dselect
 >  you choose  Access and then ftp);

  It would need some additional work to make it more resistant to
problems like the ulimit -u thing, though.  E.g., there is an unknown
host (debian.med.miami.edu) in README.mirrors, and the ping error
message regarding this host should be killed, I think.  I also noticed
during testing that there is a big difference in results between
subsequent runs of the script - perhaps it would be better to make ping
run a little longer.  Lastly, it would be nice if the script FTPed the
README.mirrors file itself (from ftp.debian.org) if not present.

  Other than the above, I found your script very useful, and I'll save
it here - it may be useful to check Simtel, sunsite, etc. mirrors too
;-)

  Gertjan.

---
-- 
Gertjan Klein <[EMAIL PROTECTED]>
The Boot Control home page: http://www.xs4all.nl/~gklein/bcpage.html


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .

Reply via email to