MiroirEOLE » Historique » Version 2
Daniel Dehennin, 26/06/2012 10:29
Publication à la charge de l’admin
1 | 1 | Daniel Dehennin | {{toc}} |
---|---|---|---|
2 | 1 | Daniel Dehennin | |
3 | 1 | Daniel Dehennin | h1. Mise en place d’un miroir des dépôts de paquet |
4 | 1 | Daniel Dehennin | |
5 | 1 | Daniel Dehennin | h2. Introduction |
6 | 1 | Daniel Dehennin | |
7 | 1 | Daniel Dehennin | Ce document décrit comment créer un miroir local des dépôts Ubuntu et EOLE. |
8 | 1 | Daniel Dehennin | |
9 | 1 | Daniel Dehennin | La méta-distribution EOLE se compose de deux sources de paquets: |
10 | 1 | Daniel Dehennin | |
11 | 1 | Daniel Dehennin | 1. Les paquets de la distribution Ubuntu, nécessite à ce jour environ 600Gio d’espace disque ; |
12 | 1 | Daniel Dehennin | |
13 | 1 | Daniel Dehennin | 2. Les paquets du projet EOLE, nécessite à ce jour environ 15Gio d’espace disque. |
14 | 1 | Daniel Dehennin | |
15 | 1 | Daniel Dehennin | La mise en place d’un miroir ce fait donc en deux étapes. |
16 | 1 | Daniel Dehennin | |
17 | 1 | Daniel Dehennin | h2. Miroir Ubuntu |
18 | 1 | Daniel Dehennin | |
19 | 1 | Daniel Dehennin | La mise en place d’un miroir Ubuntu est faisable avec l’outil "ubumirror":https://launchpad.net/ubuntu/%2Bsource/ubumirror en appliquant les patchs fournis dans réponse aux bugs "663992":https://bugs.launchpad.net/ubuntu/%2Bsource/ubumirror/%2Bbug/663992 et "939379":https://bugs.launchpad.net/ubuntu/%2Bsource/ubumirror/%2Bbug/939379 |
20 | 1 | Daniel Dehennin | |
21 | 1 | Daniel Dehennin | La configuration utilisée par le projet EOLE est la suivante |
22 | 1 | Daniel Dehennin | |
23 | 1 | Daniel Dehennin | <pre> |
24 | 1 | Daniel Dehennin | # |
25 | 1 | Daniel Dehennin | # ubumirror.conf - configuration file for the ubumirror scripts. |
26 | 1 | Daniel Dehennin | # |
27 | 1 | Daniel Dehennin | |
28 | 1 | Daniel Dehennin | # Please set the variables below to fit your site. |
29 | 1 | Daniel Dehennin | # Which email address/user that will receive failure notices. |
30 | 1 | Daniel Dehennin | EMAIL=mirror-admin@exemple.net |
31 | 1 | Daniel Dehennin | |
32 | 1 | Daniel Dehennin | # Server's FQDN. |
33 | 1 | Daniel Dehennin | HOSTNAME=$(hostname -f) |
34 | 1 | Daniel Dehennin | |
35 | 1 | Daniel Dehennin | # Bandwidth limit for all mirror scripts - set to 0 for no limit. |
36 | 1 | Daniel Dehennin | SPEED=10240 |
37 | 1 | Daniel Dehennin | |
38 | 1 | Daniel Dehennin | # UBUARC_DIR is the destination for the base of the archive directory |
39 | 1 | Daniel Dehennin | # The script won't run if this variable isn't set |
40 | 1 | Daniel Dehennin | UBUARC_DIR="/home/ftp/mirror/ubuntu/" |
41 | 1 | Daniel Dehennin | |
42 | 1 | Daniel Dehennin | # UBUCDI_DIR is the destination for the base of the cdimage directory |
43 | 1 | Daniel Dehennin | # The script won't run if this variable isn't set |
44 | 1 | Daniel Dehennin | #UBUCDI_DIR="/srv/mirror/ubuntu-cdimage" |
45 | 1 | Daniel Dehennin | |
46 | 1 | Daniel Dehennin | # UBUREL_DIR is the destination for the base of the releases directory |
47 | 1 | Daniel Dehennin | # The script won't run if this variable isn't set |
48 | 1 | Daniel Dehennin | #UBUREL_DIR="/srv/mirror/ubuntu-releases" |
49 | 1 | Daniel Dehennin | |
50 | 1 | Daniel Dehennin | # UBUPOR_DIR is the destination for the base of the ports directory |
51 | 1 | Daniel Dehennin | # The script (ubuports) won't run if this variable isn't set |
52 | 1 | Daniel Dehennin | #UBUPOR_DIR="/srv/mirror/ubuntu-ports" |
53 | 1 | Daniel Dehennin | |
54 | 1 | Daniel Dehennin | # LOGDIR is the destination directory of all the logs |
55 | 1 | Daniel Dehennin | LOGDIR="/hom/ftp/mirror/log.d/ubumirror/" |
56 | 1 | Daniel Dehennin | |
57 | 1 | Daniel Dehennin | # UBU{ARC,CDI,REL}_MIRROR is the rsync path in the form of host::directory/ of the |
58 | 1 | Daniel Dehennin | # upstream mirrors where the ubumirror scripts will mirror from. |
59 | 1 | Daniel Dehennin | UBUARC_MIRROR=ftp.crihan.fr::ubuntu/ |
60 | 1 | Daniel Dehennin | # UBUCDI_MIRROR=cdimage.ubuntu.com::cdimage/ |
61 | 1 | Daniel Dehennin | # UBUREL_MIRROR=rsync.releases.ubuntu.com::releases/ |
62 | 1 | Daniel Dehennin | # UBUPOR_MIRROR=ports.ubuntu.com::ubuntu-ports/ |
63 | 1 | Daniel Dehennin | |
64 | 1 | Daniel Dehennin | # UBUCDI_FLAVOURS is the set of image flavours to pull from UBICDI_MIRROR |
65 | 1 | Daniel Dehennin | # flavour names must match directory names on the mirror |
66 | 1 | Daniel Dehennin | # UBUCDI_FLAVOURS="\ |
67 | 1 | Daniel Dehennin | # daily daily-live \ |
68 | 1 | Daniel Dehennin | # ubuntu-netbook/daily-live ubuntu-server/daily \ |
69 | 1 | Daniel Dehennin | # " |
70 | 1 | Daniel Dehennin | |
71 | 1 | Daniel Dehennin | # UBU{ARC,CDI,REL}_EXCLUDE is what things you want to exclude |
72 | 1 | Daniel Dehennin | UBUARC_EXCLUDE="\ |
73 | 1 | Daniel Dehennin | --exclude binary-powerpc/ --exclude binary-sparc/ \ |
74 | 1 | Daniel Dehennin | --exclude daily-installer-powerpc/ --exclude daily-installer-sparc/ \ |
75 | 1 | Daniel Dehennin | --exclude installer-powerpc/ --exclude installer-sparc/ \ |
76 | 1 | Daniel Dehennin | --exclude *_powerpc.deb --exclude *_powerpc.udeb \ |
77 | 1 | Daniel Dehennin | --exclude *_sparc.deb --exclude *_sparc.udeb \ |
78 | 1 | Daniel Dehennin | --exclude Contents-powerpc.gz --exclude Contents-sparc.gz \ |
79 | 1 | Daniel Dehennin | --exclude pool/local \ |
80 | 1 | Daniel Dehennin | " |
81 | 1 | Daniel Dehennin | UBUCDI_EXCLUDE="\ |
82 | 1 | Daniel Dehennin | # --exclude *-powerpc.* --exclude *-sparc.* \ |
83 | 1 | Daniel Dehennin | # --exclude source/ \ |
84 | 1 | Daniel Dehennin | " |
85 | 1 | Daniel Dehennin | UBUREL_EXCLUDE="\ |
86 | 1 | Daniel Dehennin | # --exclude *-powerpc.* --exclude *-sparc.* \ |
87 | 1 | Daniel Dehennin | " |
88 | 1 | Daniel Dehennin | UBUPOR_EXCLUDE="\ |
89 | 1 | Daniel Dehennin | # --exclude binary-powerpc/ --exclude binary-sparc/ \ |
90 | 1 | Daniel Dehennin | # --exclude daily-installer-powerpc/ --exclude daily-installer-sparc/ \ |
91 | 1 | Daniel Dehennin | # --exclude installer-powerpc/ --exclude installer-sparc/ \ |
92 | 1 | Daniel Dehennin | # --exclude *_powerpc.deb --exclude *_powerpc.udeb \ |
93 | 1 | Daniel Dehennin | # --exclude *_sparc.deb --exclude *_sparc.udeb \ |
94 | 1 | Daniel Dehennin | # --exclude Contents-powerpc.gz --exclude Contents-sparc.gz \ |
95 | 1 | Daniel Dehennin | " |
96 | 1 | Daniel Dehennin | </pre> |
97 | 1 | Daniel Dehennin | |
98 | 1 | Daniel Dehennin | |
99 | 1 | Daniel Dehennin | h2. Miroir EOLE |
100 | 1 | Daniel Dehennin | |
101 | 1 | Daniel Dehennin | La mise en place d’un miroir EOLE requiert une autorisation réseau préalable, vous devez donc nous communiquer l’adresse IP qui sera utilisée par votre serveur miroir. |
102 | 1 | Daniel Dehennin | |
103 | 1 | Daniel Dehennin | La récupération des paquets EOLE jusqu’à la version 2.3 se fait avec le script suivant : |
104 | 1 | Daniel Dehennin | |
105 | 1 | Daniel Dehennin | <pre> |
106 | 1 | Daniel Dehennin | #!/bin/bash |
107 | 1 | Daniel Dehennin | |
108 | 1 | Daniel Dehennin | set -e -u |
109 | 1 | Daniel Dehennin | |
110 | 1 | Daniel Dehennin | MIRROR_SRC="eoleng.ac-dijon.fr::eoleng" |
111 | 1 | Daniel Dehennin | MIRROR_DST="/home/ftp/mirror/eoleng" |
112 | 1 | Daniel Dehennin | MIRROR_LOG_DIR="/home/ftp/mirror/log.d/eoleng" |
113 | 1 | Daniel Dehennin | MIRROR_LOG_FILE="${MIRROR_LOG_DIR}/eole.log" |
114 | 1 | Daniel Dehennin | |
115 | 1 | Daniel Dehennin | RSYNC_OPTS="-v --force --recursive --times --perms --links --delete-after" |
116 | 1 | Daniel Dehennin | RSYNC_EXCLUDE="--exclude mini-dinstall --exclude *.changes" |
117 | 1 | Daniel Dehennin | |
118 | 1 | Daniel Dehennin | test -d "${MIRROR_LOG_DIR}" || mkdir -p "${MIRROR_LOG_DIR}" |
119 | 1 | Daniel Dehennin | savelog -t -n -r "${MIRROR_LOG_DIR}" "${MIRROR_LOG_FILE}" |
120 | 1 | Daniel Dehennin | |
121 | 1 | Daniel Dehennin | rsync ${RSYNC_OPTS} ${RSYNC_EXCLUDE} ${MIRROR_SRC} ${MIRROR_DST} | tee -a "${MIRROR_LOG_FILE}" |
122 | 1 | Daniel Dehennin | </pre> |
123 | 1 | Daniel Dehennin | |
124 | 1 | Daniel Dehennin | Vous pouvez ensuite planifier une tâche cron comme suit: |
125 | 1 | Daniel Dehennin | |
126 | 1 | Daniel Dehennin | <pre> |
127 | 1 | Daniel Dehennin | SHELL=/bin/bash |
128 | 1 | Daniel Dehennin | PATH=~/.bin:/usr/bin:/bin |
129 | 1 | Daniel Dehennin | MAILTO=mirror-admin@example.net |
130 | 1 | Daniel Dehennin | |
131 | 1 | Daniel Dehennin | 0 5 * * * mirror-eole.sh > /dev/null |
132 | 1 | Daniel Dehennin | </pre> |
133 | 2 | Daniel Dehennin | |
134 | 2 | Daniel Dehennin | h2. Publication de votre miroir |
135 | 2 | Daniel Dehennin | |
136 | 2 | Daniel Dehennin | Il ne vous reste plus qu’à configurer un service HTTP ou FTP afin de rendre votre miroir accessible. |