Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
doc:dak:installation_de_dak_sur_ondine [2005/08/03 17:38] lehobey |
doc:dak:installation_de_dak_sur_ondine [2005/08/03 18:06] lehobey |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== Installation de dak ====== | ||
- | Notes de mon installation de dak sur ondine (d'après plusieurs journaux de telles installations). | ||
- | |||
- | [[projet:machines:Ondine]] est une machine de test en **sarge**. | ||
- | |||
- | Je suis la procédure du [[/usr/share/doc/dak/README.Debian]] dont j'ai aussi fait une [[README.Debian.fr|traduction française]]. | ||
- | |||
- | ===== Installations ===== | ||
- | ==== Installation de dak ==== | ||
- | |||
- | # aptitude install dak | ||
- | |||
- | <code> | ||
- | Les NOUVEAUX paquets suivants vont être installés : | ||
- | dak libpq3 python-apt python-egenix-mxdatetime python-gnupginterface | ||
- | python-ldap python-pygresql python2.3-egenix-mxdatetime | ||
- | python2.3-egenix-mxtools python2.3-ldap python2.3-pygresql sudo | ||
- | </code> | ||
- | |||
- | === Réponses aux questions debconf === | ||
- | J'essaie de suivre au maximum les choix par défaut. | ||
- | |||
- | == Where to put the base directory for dak? == | ||
- | /opt/dak | ||
- | |||
- | == Nom d'hôte de l'archive : == | ||
- | localhost.localdomain | ||
- | |||
- | **NB** : c'est nécessaire, en l'absence de domaine perso, pour que [[rose]] fonctionne bien. | ||
- | |||
- | == Nom de votre archive : == | ||
- | archive FDL (ondine) | ||
- | |||
- | == The name of your dak user. == | ||
- | deb-dak | ||
- | |||
- | **NB** : L'utilisation d'un tiret nécessite d'être précautionneux avec postgresql. | ||
- | |||
- | == The name of your dak group. == | ||
- | debadmin | ||
- | |||
- | **NB** : Il ne demande rien sur le groupe //debuser//. | ||
- | |||
- | [[sortie aptitude dak|Résultat]]. | ||
- | |||
- | ==== Installation de postgresql ==== | ||
- | |||
- | Je suis : | ||
- | <file> | ||
- | 6. Steps to a working dak | ||
- | ------------------------- | ||
- | |||
- | a. Have your postgresql up and running. I assume it is on the localhost, | ||
- | if not change your config files (katie.conf) for dak. | ||
- | </file> | ||
- | |||
- | # aptitude install postgresql | ||
- | |||
- | <code> | ||
- | Les NOUVEAUX paquets suivants vont être installés : | ||
- | postgresql postgresql-client | ||
- | </code> | ||
- | |||
- | === Réponses aux questions debconf === | ||
- | |||
- | == Où créer la base de données de PostgreSQL ? == | ||
- | /var/lib/postgres/data | ||
- | |||
- | == Faut-il supprimer les données à la purge du paquet ? == | ||
- | Non | ||
- | |||
- | == Paramètres régionaux utilisés par le moteur de bases de données : == | ||
- | fr_FR@euro | ||
- | |||
- | == ordre jour/mois des dates == | ||
- | Européen | ||
- | |||
- | [[sortie aptitude postgresql|Résultat]]. | ||
- | |||
- | Et le paquet nous informe : | ||
- | <file> | ||
- | A new PostgreSQL database structure was installed. | ||
- | |||
- | Use /usr/bin/createdb to create a specific database and | ||
- | /usr/bin/createuser to enable other users to connect to a | ||
- | PostgreSQL database. | ||
- | |||
- | In the first instance, these commands must be run by the | ||
- | user 'postgres'. | ||
- | </file> | ||
- | |||
- | ===== Configurations ===== | ||
- | ==== Création de l'utilisateur de la base ==== | ||
- | <file> | ||
- | b. run createuser YOURDAKUSERNAME with a user that is allowed to create | ||
- | databases and allow YOURDAKUSERNAME to create a database. This user | ||
- | needs to be superuser in the database as it runs COPY from a file later. | ||
- | </file> | ||
- | |||
- | # su - postgres | ||
- | $ createuser deb-dak | ||
- | |||
- | <code> | ||
- | Shall the new user be allowed to create databases? (y/n) y | ||
- | Shall the new user be allowed to create more new users? (y/n) y | ||
- | CREATE USER | ||
- | </code> | ||
- | |||
- | ==== Création des répertoires (par défaut) ==== | ||
- | <file> | ||
- | c. su - YOURDAKUSERNAME | ||
- | d. rose | ||
- | e. Watch how the directories are created. | ||
- | </file> | ||
- | |||
- | # su - deb-dak | ||
- | $ rose | ||
- | |||
- | [[sortie rose|Résultat]]. | ||
- | |||
- | ==== Création de la base de données de dak ==== | ||
- | Son nom dans les configurations par défaut est //projectb//. | ||
- | |||
- | # su - deb-dak | ||
- | $ createdb projectb | ||
- | <code> | ||
- | CREATE DATABASE | ||
- | $ psql -l | ||
- | List of databases | ||
- | Name | Owner | Encoding | ||
- | -----------+----------+---------- | ||
- | projectb | deb-dak | LATIN9 | ||
- | template0 | postgres | LATIN9 | ||
- | template1 | postgres | LATIN9 | ||
- | (3 rows) | ||
- | |||
- | </code> | ||
- | |||
- | ==== Création du groupe ftpmaster ==== | ||
- | <file> | ||
- | f. Add a group "ftpmaster" to your postgresql database. | ||
- | At a psql prompt a CREATE GROUP ftpmaster; should do it. | ||
- | Add your YOURDAKUSERNAME to this group. | ||
- | </file> | ||
- | |||
- | # su - deb-dak | ||
- | $ psql projectb | ||
- | |||
- | <code> | ||
- | Welcome to psql 7.4.7, the PostgreSQL interactive terminal. | ||
- | |||
- | Type: \copyright for distribution terms | ||
- | \h for help with SQL commands | ||
- | \? for help on internal slash commands | ||
- | \g or terminate with semicolon to execute query | ||
- | \q to quit | ||
- | |||
- | </code> | ||
- | |||
- | projectb=# CREATE GROUP ftpmaster ; | ||
- | |||
- | CREATE GROUP | ||
- | |||
- | projectb=# ALTER GROUP ftpmaster ADD USER "deb-dak" ; | ||
- | **NB** la présence des guillemets est expliquée dans l'anomalie [[http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=23945]]. | ||
- | |||
- | ALTER GROUP | ||
- | |||
- | projectb=# \q | ||
- | |||
- | ==== Initialisation de la base de données ==== | ||
- | <file> | ||
- | g. Change to your DAKDIR/katie and run /usr/share/dak/neve -a and watch | ||
- | her creating the database. If it ends with some VACUUM and two GRANTs | ||
- | it worked. | ||
- | Be careful, neve DROPS your database, so don't run it if you like the | ||
- | data that is in that database! | ||
- | </file> | ||
- | |||
- | # su - deb-dak | ||
- | $ cd /usr/share/dak ; neve -a | ||
- | **NB :** Le //cd// est important ! | ||
- | |||
- | [[sortie neve -a|Résultat]]. | ||
- | |||
- | ==== Création des utilisateurs ==== | ||
- | <file> | ||
- | h. You need to get your maintainers in the database. The Debian Archive | ||
- | uses a script (emilie) that syncs with its LDAP Server, but you | ||
- | probably don't want to sync with Debian's LDAP. :) | ||
- | If you have a setup with an LDAP Server, look at emilie and their | ||
- | config options. If not, there is a script called uma which helps you | ||
- | to do this. You basically give it a keyid with the -k parameter and | ||
- | it will do the rest, after asking you if you like the action. | ||
- | If you told it to create a system user for the new account it will | ||
- | run useradd to do the stuff, for that YOURDAKUSERNAME needs sudo | ||
- | access to useradd, with NOPASSWD set. It will also add new users to | ||
- | the mail whitelist file, if you have that option enabled (it is per | ||
- | default). | ||
- | </file> | ||
- | |||
- | === uma et exim4 === | ||
- | Il est nécessaire, pour que les courriels d'[[uma]] partent, d'avoir ajouté à ///etc/email-addresses// quelque chose qui ressemble à : | ||
- | <file> | ||
- | nobody: LEHOBEY@free.fr | ||
- | </file> | ||
- | |||
- | === uma et sudo === | ||
- | J'ajoute la ligne suivante à la configuration de sudo (///etc/sudoers//), avec //visudo// : | ||
- | <file> | ||
- | deb-dak ALL = NOPASSWD: /usr/sbin/useradd | ||
- | </file> | ||
- | |||
- | === Initialisation du trousseau de deb-dak === | ||
- | <file> | ||
- | k. You should setup the keyring for katie now. Do a command similar to | ||
- | the following, but adjust your path: | ||
- | gpg --no-default-keyring --keyring /opt/dak/keyrings/keyring.gpg | ||
- | </file> | ||
- | |||
- | Que je comprends comme s'appliquant à l'utilisateur //deb-dak//. | ||
- | |||
- | # su - deb-dak | ||
- | $ gpg --no-default-keyring --keyring /opt/dak/keyrings/keyring.gpg --keyserver pgp.mit.edu --recv-keys 2B022951 | ||
- | <code> | ||
- | gpg: directory `/var/lib/dak/.gnupg' created | ||
- | gpg: new configuration file `/var/lib/dak/.gnupg/gpg.conf' created | ||
- | gpg: WARNING: options in `/var/lib/dak/.gnupg/gpg.conf' are not yet active during this run | ||
- | gpg: keyring `/var/lib/dak/.gnupg/secring.gpg' created | ||
- | gpg: keyring `/opt/dak/keyrings/keyring.gpg' created | ||
- | gpg: requesting key 2B022951 from hkp server pgp.mit.edu | ||
- | gpg: key 2B022951: duplicated user ID detected - merged | ||
- | gpg: /var/lib/dak/.gnupg/trustdb.gpg: trustdb created | ||
- | gpg: key 2B022951: public key "Frederic LEHOBEY <Frederic.Lehobey@free.fr>" imported | ||
- | gpg: no ultimately trusted keys found | ||
- | gpg: Total number processed: 1 | ||
- | gpg: imported: 1 | ||
- | </code> | ||
- | |||
- | === Création du groupe debuser === | ||
- | Ce groupe est nécessaire au fonctionnement d'[[uma]]. | ||
- | |||
- | # addgroup debuser | ||
- | <code> | ||
- | Adding group `debuser' (1001)... | ||
- | Fait. | ||
- | </code> | ||
- | |||
- | === Un exemple de création d'utilisateur === | ||
- | <file> | ||
- | i. Repeat step h for every user you have. | ||
- | </file> | ||
- | |||
- | # su - deb-dak | ||
- | $ uma -k 2B022951 -u lehobey | ||
- | Option //-u// pour choisir l'identifiant de connexion. | ||
- | <code> | ||
- | 0x2B022951 -> Frederic LEHOBEY <Frederic.Lehobey@free.fr> -> lehobey -> 6750B3F2BF04A269B5D7D677289EB5222B022951 | ||
- | Add user lehobey with above data (y/N) ? y | ||
- | Added: | ||
- | Uid: lehobey (ID: 1) | ||
- | Maint: Frederic LEHOBEY | ||
- | FP: 6750B3F2BF04A269B5D7D677289EB5222B022951 | ||
- | </code> | ||
- | |||
- | ==== Installation des tâches récurrentes ==== | ||
- | <file> | ||
- | j. Install the cronjobs you need. Start with cron.unchecked which is | ||
- | already copied in /YOURDAKPATH/katie/cron.unchecked and asks | ||
- | jennifer to process new uploads. The Crontab Debian uses can be found | ||
- | in /usr/share/doc/dak/crontabs as an example. | ||
- | </file> | ||
- | |||
- | Donc à partir de l'exemple dans [[/usr/share/doc/dak/crontabs/katie.crontab]] j'installe dans les tâches récurrentes de //dak-deb// par | ||
- | $ crontab -e | ||
- | le fichier suivant : | ||
- | <file> | ||
- | SHELL=/bin/sh | ||
- | |||
- | ## Archive maintenance | ||
- | MAILTO=fdl | ||
- | 2,17,32,47 * * * * sh /opt/dak/katie/cron.unchecked | ||
- | </file> | ||
- | |||
- | Résumé des changements : | ||
- | * Remplacement de %%/org/ftp.debian.org/%% par /opt/dak/. | ||
- | * Suppression de toutes les lignes sauf [[/opt/dak/katie/cron.unchecked]]. | ||
- | * MAILTO changé de cron@yourhost.yourdomain à fdl (qui existe sur ondine). | ||
- | |||
- | === Test de cron.unchecked === | ||
- | C'est essentiellement [[jennifer]] qui est à l'oeuvre. | ||
- | $ sh -x /opt/dak/katie/cron.unchecked | ||
- | [[sortie cron.unchecked|Résultat]]. | ||
- | |||
- | ==== Une clef pour ziyi ==== | ||
- | <file> | ||
- | l. To let ziyi sign the Release files you need a s3kr1t key. | ||
- | gpg --gen-key and follow the prompts. Then move it from the home of | ||
- | YOURDAKUSERNAME to the path of "SigningKeyring" from the | ||
- | config. Both, public and private key. Write your Keyid in the config | ||
- | value "SigningKeyIds". Remember that the signing works automagically, | ||
- | so a passphrase on the key doesnt help... | ||
- | </file> | ||
- | |||
- | |||
- | ===== Désinstallations ===== | ||
- | ==== Désinstallation de dak ==== | ||
- | Avec les ajouts nécessaires pour contourner l'anomalie de dak dans sarge (avec les valeurs de debconf par défaut). | ||
- | |||
- | # aptitude purge dak | ||
- | |||
- | Pour virer les configurations oubliées par l'anomalie : | ||
- | # ucf --purge /opt/dak/katie/apt.conf | ||
- | # ucf --purge /opt/dak/katie/cron.unchecked | ||
- | # ucf --purge /opt/dak/katie/katie.conf | ||
- | # ucf --purge /etc/katie/katie.conf | ||
- | # ucf --purge /opt/dak/katie/vars | ||
- | # ucf --purge /opt/dak/katie/Contents.top | ||
- | |||
- | Pour faire le propre : | ||
- | # rm -r /etc/katie | ||
- | (attention, ci-dessous c'est toute l'archive que le mainteneur a fait exprès de laisser) | ||
- | # rm -r /opt/dak | ||
- | |||
- | **Penser à virer le //crontab// de deb-dak** si on a mis quelque chose dedans. | ||
- | |||
- | Pour aussi virer les utilisateur et groupe créés. | ||
- | # deluser deb-dak | ||
- | # delgroup debadmin | ||
- | et s'il a été créé : | ||
- | # delgroup debuser |