"make install" slow ftp download sites, how to change?

When I do the 'make clean install' tango to install stuff from ports, sometimes the tar file is downloaded from slow ftp servers.

ie: mySQL client
Code:
=> mysql-5.0.77.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from ftp://ftp.fi.muni.cz/pub/mysql/Downloads/MySQL-5.0/.

I seem to remember some discussion about this on the defunct bsdforums site but I cannot remember what was said. Is there any particular reason why a server in the Czech Republic was selected to download from? And if it is selectable, how can I point it to faster servers?

Thanks!
 
If you look at the Makefile for that port, you will see that it uses a variable called "MASTER_SITE_MYSQL" to provide a list of mirrors from which the sources can be downloaded. You can define that variable yourself, with sites that are faster for you at the top of the list.

That variable only applies to mysql, of course.
Other ports may use other variables or define the download sites directly.

As to why some particular site was chosen as the top choice, you would need to ask the people who committed the file containing the list. The usual reason is that certain sites are more authoritative for the project in question than others.
 
johnblue said:
I seem to remember some discussion about this on the defunct bsdforums site but I cannot remember what was said. Is there any particular reason why a server in the Czech Republic was selected to download from? And if it is selectable, how can I point it to faster servers?

Thanks!
I wish one could set a minimum transfer rate. Basically abort if it goes below about 5kbps or so.

What I do is temporarily add the URL to my firewalls block list. It can't connect and will pretty quickly switch to another site.
 
Lowell said:
If you look at the Makefile for that port, you will see that it uses a variable called "MASTER_SITE_MYSQL" to provide a list of mirrors from which the sources can be downloaded. You can define that variable yourself, with sites that are faster for you at the top of the list.

That variable only applies to mysql, of course.
Other ports may use other variables or define the download sites directly.

As to why some particular site was chosen as the top choice, you would need to ask the people who committed the file containing the list. The usual reason is that certain sites are more authoritative for the project in question than others.

Thank you very much:P
 
this work for some ports as i know :
Code:
MASTER_SITE_OVERRIDE= \
ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch
Mr DutchDaemon tell me from where you get like this configuration files ,i had not seen it FreeBSD handbook .
 
I don't know what you mean .. the /usr/local/etc/ports_sites.conf gets created by putting the command from post #5 in root's crontab. Every time the cron job runs, that file gets updated with the fastest mirrors.
 
DutchDaemon said:
Try ports-mgmt/fastest_sites.

You can run it from cron like this:

Code:
0 6 * * *       /usr/local/bin/fastest_sites > /usr/local/etc/ports_sites.conf

and reference it from /etc/make.conf like this:

Code:
.include "/usr/local/etc/ports_sites.conf"

That's all.

Is there anything that has to be configured to enable this? Or does it automatically work after rehash?
 
DutchDaemon said:
Try ports-mgmt/fastest_sites.

You can run it from cron like this:

Code:
0 6 * * *       /usr/local/bin/fastest_sites > /usr/local/etc/ports_sites.conf

and reference it from /etc/make.conf like this:

Code:
.include "/usr/local/etc/ports_sites.conf"

That's all.

I'm sorry. I'm not familiar with cron jobs. How is the command run in the
Code:
 section? I tried 
[code]fastest_sites > /usr/local/etc/ports_sites.conf &
then adding this to /etc/make.conf
Code:
.include "/usr/local/etc/ports_sites.conf"

Does this achieve the same results?
 
Yes, but you will only get one result with that. You should run this on a regular basis, which is usually achieved by putting it in a cron job.

As root:
[cmd=]crontab -e[/cmd]

Paste:
Code:
0 6 * * *       /usr/local/bin/fastest_sites > /usr/local/etc/ports_sites.conf

Save.

And it will run each day at 6 AM.
 
Yes, but you will only get one result with that. You should run this on a regular basis, which is usually achieved by putting it in a cron job.

As root:
[cmd=]crontab -e[/cmd]

Paste:
Code:
0 6 * * *       /usr/local/bin/fastest_sites > /usr/local/etc/ports_sites.conf

Save.

And it will run each day at 6 AM.

This error of 0 bad hour is coming:
Code:
/tmp/crontab.jLAVYGGbZy: 1 lines, 91 characters.
crontab: installing new crontab
"/tmp/crontab.jLAVYGGbZy":0: bad hour
crontab: errors in crontab file, can't install
Do you want to retry the same edit?
 
The line I posted is correct. If it doesn't work, there must be an error or a typo (control character, vi command?) in it.
 
Below are the first lines of my /etc/crontab. Here the minutes come first.
Code:
# /etc/crontab - root's crontab for FreeBSD
#
# $FreeBSD: stable/10/etc/crontab 194170 2009-06-14 06:37:19Z brian $
#
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
#
#minute hour  mday  month  wday  who  command
#
*/5  *  *  *  *  root  /usr/libexec/atrun
I am not sure, but swapping the 0 and the 6 might be better.
 
I doubt it. This is a copy and paste of the line, and a copy and paste of the result.
Code:
0 6 * * *       /usr/local/bin/fastest_sites > /usr/local/etc/ports_sites.conf

"/tmp/crontab.khtWpIrhBa" 3 lines, 201 characters
crontab: installing new crontab
 
Dear DutchDaemon,
No, read crontab(5), it's "0 6" for 6:00.

And don't edit /etc/crontab, edit the user's crontab.
I have tried crontab -e and entered the line you have proposed. I can confirm that the line is accepted. It works as normal user and as root. I should have tried that first. I have been irritated by the error message regarding hour 0. Sorry for the noise.
 
Strange this time crontab -e followed by the line
Code:
0 6 * * * /usr/local/bin/fastest_sites > /usr/local/etc/ports_sites.conf
gave good results
Code:
/tmp/crontab.iIfg3ylVXj: 2 lines, 2 characters.
crontab: installing new crontab

crontab -l showed this
Code:
root@noname:/home/bsdfrankie # crontab -l


root@noname:/home/bsdfrankie #

A total blank. Now if I want to edit 0 6 to something else I am unable to do this.

Code:
$ uname -a
FreeBSD noname.noname.edu 10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 22:51:51 UTC 2014  root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  i386
 
See if it shows up under /var/cron/tabs/ somewhere.

It does show that installation has taken place
Code:
root@noname:/var/cron/tabs # cat root
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.iIfg3ylVXj installed on Wed Jan  7 16:53:09 2015)
# (Cron version -- $FreeBSD: releng/10.1/usr.sbin/cron/crontab/crontab.c 239991 2012-09-01 14:45:15Z ed $)

How am I supposed to edit it?
 
Dear ankscorek, just in case you are not familiar with vi. crontab -e as root is correct. It copies the current crontab into a vi. Press "i" to change to the insert mode. Then insert the line, either by typing or by copy and paste. Then press the key <esc> to leave the insert mode. If you do it more often the computer might beep, but this is ok. Then type ":wq". This should save the file and close the editor. This is very intuitive ;). The new crontab should appear as the result of crontab -l.
 
If that is too involved, run the command export EDITOR=ee or setenv EDITOR ee (depending on your shell) before running crontab -e That'll give you an easier editor.
 
Last edited:
Back
Top