Posts Tagged GNU/Linux
Better jesred rules
Posted by Lionel Porcheron in Uncategorized on July 1, 2008
A friend of mine give me better rules for jesred. You can now browse the repository in the browser:
regex ^http://((.*)archive.ubuntu.com/ubuntu/(dists|pool)/.*(deb|bz2|Release|Release.gpg))$ http://apt-cacher:3142/\1
regex ^http://(security.ubuntu.com/ubuntu/(dists|pool)/.*(deb|bz2|Release|Release.gpg))$ http://apt-cacher:3142/\1
Thanks Jerôme!
Bandwith optimization: squid, apt-cacher and jesred
Posted by Lionel Porcheron in Uncategorized on April 28, 2008
At work, I now have around 50 desktops running Ubuntu and around 40 servers (including customers machines) also running Ubuntu. As you can imagine, when you have a security update of X, this represents a lot of bandwith usage! Not to speak about Hardy upgrade! We started to look at different solutions to optimize our precious bandwith.
Some search gave:
- local mirror: huch… this is a bit too much for us
- squid usage: good, but you need to tweak too much your squid installation to keep your .deb inside the pool. And squid can make .deb expires even they are still valid.
- apt-proxy/apt-cacher/apt-cacher-ng: all looks good but… you have to modify your client configuration. As I am lazy, I don’t want to do that (and also, because I have mobile users who only want to use the cache when they are on the corporate network). Between the three, I chose apt-cacher, just based on some reading on the web… Other may be as good as apt-cacher!
We selected the association: squid + apt-cacher + jesred. Let’s have a look on each component:
- apt-cacher: .deb and Packages/Source cache. You can also import data from another source (for exemple from a cd-rom).
- squid: THE proxy, we use it as a transparent proxy in our case.
- jesred: rewrite squid URL and redirect access to the Ubuntu archive to apt-cacher.
The installation described below was made on a Ubuntu 8.04. The machine is a Xen virtual machine (I’ll talk about Xen another time
). All the softwares are taken from Ubuntu repositories: squid beeing in main, other packages are in universe (ensure universe is enabled). Installation and configuration is really easy!
squid installation
# apt-get install squid
squid configuration
Edit /etc/squid.conf and add in ACL definititions:
acl mylan src 10.0.0.0/255.255.0.0
Allow traffic from you network:
http_access allow mylan
You can now test your squid. It should be operational.
apt-cacher installation
# apt-get install apt-cacher
I just changed the admin_email value in /etc/apt-cacher/apt-cacher.conf
As a quick test, set http_proxy env value and try to use apt. Everything should go throught the cache (check the logs).
jesred installation
# apt-get install jesred
jesred configuration
Edit /etc/jesred.acl to authorize your network (just add you lan at the end of the file).
Edit /etc/jesred.rules and add:
regex ^http://((.*)archive.ubuntu.com/ubuntu/(dists|pool)/.*)$ http://localhost:3142/\1
regex ^http://(security.ubuntu.com/ubuntu/(dists|pool)/.*)$ http://localhost:3142/\1
I have also added two aborts in order to use upgrade-manager:
abort .gpg
abort ReleaseAnnouncement
Last but not least, the glue between all the elements:
Edit /etc/squid.conf and add:
redirect_program /usr/lib/squid/jesred
Finished ! Now your squid redirect all requests to *archive.ubuntu.com and security.ubuntu.com to apt-cacher. Happy installation / upgrades!
Ubuntu Server Team
Posted by Lionel Porcheron in Uncategorized on November 2, 2007
One of the thing I should have done on the 18th of october, is blogging about the new Ubuntu release : 7.10, codename Gutsy Gibbon. No need to make another list of new (great) features included in the release, I would like to talk about the server team.
During gutsy cycle, Canonical have hired a bunch of people for taking care of the server platform. The team has been growing (thanks to the community), and we are now 78 members. This team is working hard to make Ubuntu Server rocks (well, it’s already rocks, but rocks more). First results have reached gutsy, there will be more for hardy, the next Ubuntu release (due in April) which will be a LTS (Long Term Support, which for the server team means 5 years).
Lot of people have been asking “Why I should use Ubuntu as a server, Ubuntu is a desktop distro?”. I remember Adam Conrad saying about differences between Debian and Ubuntu as a server : “Release schedule, LTS releases, commercial support from Canonical, and a different logo”. From my experience, I think it is an excellent summary of the advantages of Ubuntu.
If you’re looking into contributing or if you want to help us, reporting bug is a good starting point!
Canonical Landscape
Posted by Lionel Porcheron in Uncategorized on August 17, 2007
During Ubuntu Live in Portland, Canonical (the Ubuntu main sponsor) announced the availability of Landscape a tool for Canonical support customers.
This tool was designed to manage your IT infrastructure: all your servers/desktops/laptops are configurable through a web interface. The web interface also permit to get an inventory (hardware and software), to monitor them, etc. For a complete (and better) description visit the presentation page on Canonical website.
This tool appears to be the dreamed tool for the sysadmin I am. I have to confess that we have started a super-secret project for a similar tool. Well, that’s said, I also have to confess that landscape looks better than our tool right now…
seamlessrdp: Windows applications integrated in your Linux desktop
Posted by Lionel Porcheron in Uncategorized on August 14, 2007
Cendio has recently released in OpenSource a component called “seamlessrdp”. The difference with opening a session with rdesktop on a Windows server it that individual application is integrated in your environement.
You need two components : a component on the server side, another on the client side. On the client side, rdesktop superior to 1.5 get it.
For the server side, you will get details intructions on Cendio seammlessrdp webpage. It just consists in unzipping a zip somewhere on your Windows machine.
Here is the command line I use to launch Internet Explorer on a remote machine :
$ rdesktop -a 24 -A -s "c:\seamlessrdp\seamlessrdpshell.exe c:\program files\internet explorer\iexplore.exe" windows_server -u lionel -p -
Here is the result on my desktop :
command-not-found package in Ubuntu
Posted by Lionel Porcheron in Uncategorized on March 16, 2007
The package command-not-found is now part of the default Ubuntu Desktop installation. What does the command-not-found package do ? Let’s take an example:
lionel@ouessant:~$ mutt
The program 'mutt' is currently not installed. You can install it by typing:
sudo apt-get install mutt
bash: mutt: command not found
When a command is not found in your computer, it search in a database in which package this command is and give you the command to install it.
Great isn’t it ?
Ruby On Rails: for development only!
Posted by Lionel Porcheron in Uncategorized on February 19, 2007
For my blog and some other services (mainly mails), I am using a dedicated software hosted by a professionnal ISP. Last week-end, I migrated all the services to my new platform (with more RAM as my old server was swapping most of the time). I had to reinstall all services.
Now my server is under Ubuntu (yeah, Ubuntu rocks !) reinstalling software was really easy: courier, postfix, apache, php, mysql, all come in packages, and work mostly out of the box.
I am also hosting some Rails site for friends. Migration was a nightmare! Installing PHP/MySQL took me 10min, same for Python. Rails took me… half a day and I had to end up with incantations to get it work (“Rails failed to start”… thanks for the error message !). After it startup, Rails version changed: applications does not start any more…
I am happy with my choice of Django (in python) for personal development !
Connexion efficace à l’IRC
Posted by Lionel Porcheron in Uncategorized on January 4, 2007
Lucas demandait aujourd’hui dans un billet sur son blog le meilleur moyen de se connecter à l’IRC. Je répondrai ici en Français (Lucas, comment on fait pour répondre quand les commentaires et les trackback sont fermés ?
). Ma solution sera un peu différente de celle présentée par Christian Perrier.
J’ai les mêmes contraintes que Lucas (en plus je change de machine entre mon domicile et le travail), je m’étais penché sur le sujet il y a quelques temps, en sachant que je n’étais pas du tout fan d’irssi moi non plus. Pourtant, irssi dispose d’un plugin génial : le mode proxy. Pour l’activer, il suffit de faire dans sa configuration irssi :
settings = {
core = {
real_name = “Lionel Porcheron”;
user_name = “lionel”;
nick = “lionel”;
};
proxy = {
irssiproxy_password = “hackme”;
irssiproxy_ports = “freenode=3600 rezosup=3601 oftc=3602″;
irssiproxy_bind = “192.168.1.10″;
};
};
Pour charger le mode proxy, il faut faire depuis irssi un “/load proxy”. Je lance ensuite un irssi sur un serveur dans un screen, ce qui donne le résultat ci-dessous:
Je peux bien sûr comme Christian utiliser mon irssi dans mon screen, mais surtout, moi qui aime les interfaces graphiques, je peux utiliser mon client préféré, alias xchat-gnome. Pour cela, il suffit de définir des nouveaux réseaux : comme serveur on rentre le port du proxy et comme adresse du serveur l’adresse définie dans le fichier de configuration d’irssi. Le mot de passe du serveur est le mot de passe défini dans irssi (et non pas celui de connexion au réseau). Côté client, on ne voit aucune différence.
Bien sûr, ce n’est pas très sécurisé, et quand on est “à l’extérieur”, ça ne marche pas. Pour cela, j’utilise (vous l’avez senti arriver) un tunnel ssh:
ssh -L 3602:toulouse:3602 -L 3601:toulouse:3601 -L 3600:toulouse:3600 chez_moi
Ce tunnel me permet de n’importe où de me connecter de la même façon à l’IRC. Pour simplifier la configuration de xchat, je l’utilise même en local.
Autre point positif, une fois la configuration IRC définie sur le serveur, le paramétrage d’un client est trivial : pas de cannaux de connexion à définir, juste un triplet : serveur, port, mot de passe à rentrer.
Cerise sur le gateau, irssi dispose dans ses plugins de base d’un script “awayproxy” (à place dans .irssi/scripts/autorun pour le lancer automatiquement). Ce script vous permet de vous placer automatiquement “away” quand vous n’avez pas de client connecté au proxy, et vous envoie un mail avec le contenu du message quand on vous highlight sur un canal (oui, je n’aime pas loguer inutilement tous les canaux sur lesquel j’iddle, d’autres font ça pour moi).
Je trouve ça en plus beaucoup plus pratique (avec la possibilité de popup quand on est hightlighté sur un canal qui passent bien souvent à la trape dans une fenêtre irssi…).
Et merci PierreF et Dobermann de m’avoir donné cette solution il y a un peu plus d’un an maintenant. J’en suis très satisfait !
Créer un repository yum pour RHEL 4.0
Posted by Lionel Porcheron in Uncategorized on December 4, 2006
J’utilise à des fins de tests, une RHEL 4.0 et étant habitué à apt (vous avez remarqué que les billets traitent plutôt de Debian et Ubuntu généralement non ?), apt me manque terriblement ! yum fournit une solution acceptable (même si je continue à préférer apt), mais il n’est pas disponible sur la RHEL
. Après avoir vu ce qu’avait fait un de nos clients, je me suis donc lancé : installer yum sur les RHEL et mettre en place un dépôt yum local (pour ne plus à avoir à choisir un CD et à fouiller dedans, puis passer au suivant…). Les utiliser deviendrait presque agréable après !
Voici donc la procédure à suivre.
On commence par copier le contenu de tous les CD sur le disque (cela servira de miroir après) :
mount -o loop /srv/media/RHEL4-U3-i386-AS-disc1.iso /mnt/
cp -ar /mnt/* /srv/www/yum/4/i386/os/
umount /mnt
mount -o loop /srv/media/RHEL4-U3-i386-AS-disc2.iso /mnt/
cp -ar /mnt/* /srv/www/yum/4/i386/os/
umount /mnt
mount -o loop /srv/media/RHEL4-U3-i386-AS-disc3.iso /mnt
cp -ar /mnt/* /srv/www/yum/4/i386/os/
umount /mnt
mount -o loop /srv/media/RHEL4-U3-i386-AS-disc4.iso /mnt/
cp -ar /mnt/* /srv/www/yum/4/i386/os/
On va ensuite créer les données propres au repository yum. Pour cela, il faut utiliser la commande “createrepo”, disponible dans Debian Sid et dans Ubuntu Feisty (mais elle s’installe très bien sur une Edgy).
createrepo /srv/www/yum/4/i386/os/
On installe ensuite la commande yum sur notre station RHEL :
wget http://centos.cs.ucr.edu/centos/4.4/apt/i386/RPMS.os/python-urlgrabber-2.9.8-2.noarch.rpm
wget http://centos.cs.ucr.edu/centos/4.4/apt/i386/RPMS.os/python-sqlite-1.1.7-1.2.i386.rpm
wget http://centos.cs.ucr.edu/centos/4.4/apt/i386/RPMS.os/python-elementtree-1.2.6-4.2.1.i386.rpm
wget http://centos.cs.ucr.edu/centos/4.4/apt/i386/RPMS.os/yum-2.4.3-1.c4.noarch.rpm
wget http://centos.cs.ucr.edu/centos/4.4/apt/i386/RPMS.os/sqlite-3.3.3-1.2.i386.rpm
wget http://centos.cs.ucr.edu/centos/4.4/os/x86_64/CentOS/RPMS/centos-yumconf-4-4.5.noarch.rpm
rpm -Uvh *.rpm
Ensuite, il reste à configurer notre repository (nous supposerons ici que nous le contenu a été préalablement placé dans un répertoire servi par un serveur http). Créer un fichier
/etc/yum.repos.d/local.repo
avec le contenu :
[local-rhel]
name=Red Hat Enterprise Linux $releasever
baseurl=http://packages.local/redhat/RHEL/4/i386/os/RedHat/
failovermethod=priority
gpgcheck=1
gpgkey=http://packages.local/redhat/RHEL/4/i386/os/RPM-GPG-KEY
enabled=1
Et c’est parti : yum update / yum install !
Pourquoi j’arrête le XFS !
Posted by Lionel Porcheron in Uncategorized on October 6, 2006
Il y a quelques années de cela, je m’étais penché sur les différents systèmes de fichiers existants sous Linux. J’avais retenu XFS pour deux points:
- il était largement plus performant avec un noyau 2.6 que le système plus traditionnel ext3
- il proposait de base les ACL (alors qu’il fallait à l’époque patcher son noyau pour pouvoir en disposer sur l’ext3).
J’avais rejeté reiserfs et jfs que je trouvais trop confidentiels.
Le site Debian Administration a publié un article complet sur les comparaisons des systèmes de fichiers existants. Il présente de manière bien plus complète que ce billet les avantages / inconvéniants de chacun.
Cela fait plusieurs fois que j’ai vu des systèmes de fichiers XFS se corrompre (jusque là, j’ai toujours récupéré la situation avec des xfs_repair), mais il y a quelques jours, j’ai vu avec stupéfaction dans mes logs d’un serveur un production :
Filesystem "sdb1": XFS internal error xfs_da_do_buf(2) at line 2273 of file fs/xfs/xfs_da_btree.c. Caller 0xf8a989e8 <f8a983e8> xfs_da_do_buf+0x3d8/0x920 xfs <f8a989e8> xfs_da_read_buf+0x58/0x60 xfs <f8a989e8> xfs_da_read_buf+0x58/0x60 xfs <f8ab1984> xfs_itobp+0x114/0x260 xfs <f8a989e8> xfs_da_read_buf+0x58/0x60 xfs <f8a9c3bd> xfs_dir2_block_getdents+0xad/0x360 xfs <f8a9c3bd> xfs_dir2_block_getdents+0xad/0x360 xfs <f8ad1ccf> xfs_access+0x4f/0x60 xfs <f8ad1ccf> xfs_access+0x4f/0x60 xfs <f8a8a025> xfs_bmap_last_offset+0xc5/0x130 xfs <f8a9b710> xfs_dir2_put_dirent64_direct+0x0/0xa0 xfs <f8a9b650> xfs_dir2_isblock+0x30/0x80 xfs <f8a9b710> xfs_dir2_put_dirent64_direct+0x0/0xa0 xfs <f8a9ae89> xfs_dir2_getdents+0xb9/0x160 xfs <f8a9b710> xfs_dir2_put_dirent64_direct+0x0/0xa0 xfs <f8ad52f0> xfs_readdir+0x60/0xc0 xfs <f8add7c6> linvfs_readdir+0x116/0x230 xfs <c0175687> vfs_readdir+0xa7/0xc0 <c0175980> filldir64+0x0/0x100 <c0175aee> sys_getdents64+0x6e/0xaa <c0175980> filldir64+0x0/0x100 <c01061eb> syscall_call+0x7/0xb
Pourtant, la machine n’avait pas rebooté violemment, rien de spécial à signaler. XFS est un système de fichier capable de se corompre en fonctionnement “normal” ! Problème similaire sur un portable où c’était la partition racine qui était concernée et où xfs_repair n’a pas été en mesure de réparer : il a fallu reformater et donc réinstaller !
Je ne suis pas le seul à avoir ce genre de considérations. Cet été, Martin f. Krafft a publié un billet sur son blog où il expliquait ses problèmes avec XFS.
Cela étant, maintenant, je crois que pour moi, ça sera de l’ext3 partout !