@fweisbec @zepag#DevoxxLinux101
Linux 101
@fweisbec
Frédéric Weisbecker (RedHat)
@zepag
Pierre-Antoine Grégoire (Agile Partner)
@fweisbec @zepag#DevoxxLinux101
Cékouakecé
more /etc/*releasecat /proc/cpuinfolscpucat /proc/meminfouname admesg |moredmesg H
@fweisbec @zepag#DevoxxLinux101
Filesystem Hierarchy Standard (FHS)
/bin
/boot/dev/etc/home/lib/lib<arch>/media/mnt/opt/root/sbin/srv/tmp/usr/var
Boot systemImages
Boot loader
@fweisbec @zepag#DevoxxLinux101
Filesystem Hierarchy Standard (FHS)
/bin/boot/dev
/etc/home/lib/lib<arch>/media/mnt/opt/root/sbin/srv/tmp/usr/var
Configuration
@fweisbec @zepag#DevoxxLinux101
Filesystem Hierarchy Standard (FHS)
/bin/boot/dev/etc/home/lib/lib<arch>/media/mnt/opt/root/sbin/srv/tmp
/usr/var
Pas requis pour un système minimal
PartageablePeut être read-only
Peut être monté à distanceSouvent une partition
distincte
/bin/lib/lib<arch>/local/sbin/share
@fweisbec @zepag#DevoxxLinux101
Filesystem Hierarchy Standard (FHS)
/bin/boot/dev/etc/home/lib/lib<arch>/media/mnt/opt/root/sbin/srv/tmp/usr
/var
Ne devrait pas être monté read-only
Contenu variableSouvent une partition
distincte/cache/lib/lib<arch>/local/log/opt/tmp
@fweisbec @zepag#DevoxxLinux101
Filesystem Hierarchy Standard (FHS)
/bin/boot/dev/etc/home/lib/lib<arch>/media/mnt/opt/root
/sbin/srv/tmp/usr/var
Binaires pour un système minimal
/bin pour tous les utilisateurs/sbin pour root uniquement
@fweisbec @zepag#DevoxxLinux101
Filesystem Hierarchy Standard (FHS)
/bin/boot/dev/etc/home
/lib/lib<arch>/media/mnt/opt/root/sbin/srv/tmp/usr/var
Librairies requises par les binaires de /bin et /sbinPeuvent être spécifiques
d'une architectureContiennent les librairies du
Kernel
@fweisbec @zepag#DevoxxLinux101
Filesystem Hierarchy Standard (FHS)
/bin/boot/dev/etc/home/lib/lib<arch>/media/mnt
/opt/root/sbin/srv/tmp/usr/var
Applications additionellesConfigurées dans /etc/opt/Données variables dans
/var/opt/Usage dépendant des
distributions/packageursSouvent remplacé par
/usr/local
@fweisbec @zepag#DevoxxLinux101
Filesystem Hierarchy Standard (FHS)
/bin/boot/dev/etc/home/lib/lib<arch>/media/mnt/opt/root/sbin/srv
/tmp/usr/var
Fichiers temporairesPréférez /var/tmp/ pour un
stockage temporaire persistant
Purgé périodiquementExplicitement pas fiable
@fweisbec @zepag#DevoxxLinux101
Filesystem Hierarchy Standard (FHS)
/bin/boot
/dev/etc/home/lib/lib<arch>
/media/mnt/opt/root/sbin/srv/tmp/usr/var
/dev gestion des « devices » virtuels ou physiques (udev)/mnt point de montage pour
les systèmes de fichiers temporaires
/media médias amovibles (clé usb)
@fweisbec @zepag#DevoxxLinux101
Filesystem Hierarchy Standard (FHS)
/bin/boot/dev/etc
/home/lib/lib<arch>/media/mnt/opt
/root/sbin/srv/tmp/usr/var
Répertoire « Home » des utilisateurs
/root est le répertoire « home » de
l'utilisateur root
@fweisbec @zepag#DevoxxLinux101
Filesystem Hierarchy Standard (FHS)
/bin/boot/dev/etc/home/lib/lib<arch>/media/mnt/opt/root/sbin
/srv/tmp/usr/var
Eléments servis au travers du réseau
wwwnfsftp
samba...
@fweisbec @zepag#DevoxxLinux101
Filesystem Hierarchy Standard (FHS)
/bin/boot/dev/etc/home/lib/lib<arch>/media/mnt/opt/root/sbin/srv/tmp/usr/var
Beaucoup de petites variations entre
distros Linux
@fweisbec @zepag#DevoxxLinux101
Naviguer dans le filesystem
lspwdpushd/popdfindgrep rnw '<path>' e '<patterninfile>'locateupdatedb
@fweisbec @zepag#DevoxxLinux101
Terminaux et shells
ps aux | grep ttyps aux | grep ptsls al /dev/pts/CtrlAltF1 à F6ttysttyman loginecho $SHELL
@fweisbec @zepag#DevoxxLinux101
Droits d'accès et utilisateurs
stat /etc/hostsstat /bin/sustat /bin/lockfilecat /etc/passwdchmodsusudousers
@fweisbec @zepag#DevoxxLinux101
RTFM
helpmanapropos--helpwhichcompletion (bash completion ou zsh completion)
@fweisbec @zepag#DevoxxLinux101
Disques et points de montage
du hs /var/*du hsBM /var/* |sort ndf h
@fweisbec @zepag#DevoxxLinux101
Logical Volume Manager (LVM)
@fweisbec @zepag#DevoxxLinux101
Logical Volume Manager (LVM)
fdisk lpvcreate /dev/sdb1 /dev/sdb2 /dev/sdb3vgcreate vg1 /dev/sdb1 /dev/sdb2lvcreate L 150M vg1 n lv1pvdisplay/vgdisplay/lvdisplaymkfs.<*> /dev/vg1/lv1mount /dev/vg1/lv1 ./foovgextend vg1 /dev/sdb3lvresize L +100M /dev/vg1/lv1 resize2fs /dev/vg1/lv1lvremove/vgremove/pvremove
@fweisbec @zepag#DevoxxLinux101
Boot/Kernel
@fweisbec @zepag#DevoxxLinux101
Init●1ère tâche après le boot du kernel: /bin/init (PID=1)
●Racine de l'arbre des processus
●Principaux Roles– Mettre en place le hardware :
● Montage des partitions● Démarrage du réseau● ...
– Démarrer les services :● Ssh, ● X/Gnome/Kde, ● ...
@fweisbec @zepag#DevoxxLinux101
SYS V Init
Runlevels 1-6– 0 = halt– 1= single user– 2-5 = multiuser– 6 = reboot
@fweisbec @zepag#DevoxxLinux101
Upstart●Exécute les scripts de manière concurrente
●Arbre des dépendances Hardcodé: ● Sshd ...● dépend du network manager...● dépend du WIFI...● dépend de...
@fweisbec @zepag#DevoxxLinux101
SystemD●Exécute les scripts de manière concurrente
●Remplace le processus init en tant que processus avec PID 1.
●Dépendances à la demande: sockets files, Dbus, automount, etc...
●Meilleur suivi des processus: cgroup
@fweisbec @zepag#DevoxxLinux101
Services/Init
systemctlsystemdcglspstree
@fweisbec @zepag#DevoxxLinux101
Configuration
find /etcapropos conf
@fweisbec @zepag#DevoxxLinux101
Packaging
yumzypperaptget,aptcache
rpmdpkg*
@YourTwitterHandle#DVXFR14{session hashtag} @fweisbec @zepag#DevoxxLinux101
Q & A
@fweisbec @zepag#DevoxxLinux101
Crédit image / Creative Commons• Rue pavée — By-Nc-Sa
•http://www.flickr.com/photos/22914687@N05/4957591422/sizes/l/
• Sous la Tour Eiffel — By-Nc-Sa
•http://www.flickr.com/photos/stewiedewie/244850735/sizes/l/in/photostream/
• Sous le pont — photo par B.Monginoux - By-Nc-Nd
•http://www.landscape-photo.net/displayimage.php?pid=5194
• Le Louvre – Photo par Anthony Gaudun - By-Nc-Sa
•http://www.flickr.com/photos/anthonygaudun/7474397964/sizes/o/in/photostream/
• Slide template created by @glaforge, completed by @nmartignole for Devoxx FR2014