Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
elearning:workbooks:docker3:drf00 [2021/11/21 11:32] – created admin | elearning:workbooks:docker3:drf00 [2024/02/21 13:42] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
- | Version : **2021.01** | + | Version : **2024.01** |
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
Ligne 15: | Ligne 15: | ||
* Présentation des Namespaces | * Présentation des Namespaces | ||
* Présentation des CGroups | * Présentation des CGroups | ||
- | * LAB #1 - Travailler avec les CGroups | + | * LAB #1 - cgroups v1 |
- | * 1.1 - Limitation de la Mémoire | + | * 1.1 - Préparation |
- | * 1.2 - Le Paquet cgroup-tools | + | * 1.2 - Présentation |
- | * La commande | + | * 1.3 - Limitation de la Mémoire |
- | * La Commande cgexec | + | * 1.4 - La Commande |
- | * La Commande cgdelete | + | * 1.5 - La Commande cgexec |
- | * Le Fichier / | + | * 1.6 - La Commande cgdelete |
+ | * 1.7 - Le Fichier / | ||
+ | * 1.8 - La Commande cgconfigparser | ||
+ | * LAB #2 - cgroups v2 | ||
+ | * 2.1 - Préparation | ||
+ | * 2.2 - Présentation | ||
+ | * 2.3 - Limitation de la CPU | ||
+ | * 2.4 - La Commande systemctl set-property | ||
* Présentation de Linux Containers | * Présentation de Linux Containers | ||
- | * LAB #2 - Travailler avec LXC | + | * LAB #3 - Travailler avec LXC |
- | * 2.1 - Installation | + | * 3.1 - Installation |
- | * 2.2 - Création d'un Conteneur Simple | + | * 3.2 - Création d'un Conteneur Simple |
- | * 2.3 - Démarrage d'un Conteneur Simple | + | * 3.3 - Démarrage d'un Conteneur Simple |
- | * 2.4 - S' | + | * 3.4 - S' |
- | * 2.5 - Commandes LXC de Base | + | * 3.5 - Commandes LXC de Base |
* La Commande lxc-console | * La Commande lxc-console | ||
* La Commande lxc-stop | * La Commande lxc-stop | ||
Ligne 36: | Ligne 43: | ||
* La Commande lxc-unfreeze | * La Commande lxc-unfreeze | ||
* Autres commandes | * Autres commandes | ||
- | * 2.6 - Création d'un Conteneur Non-Privilégié | + | * 3.6 - Création d'un Conteneur Éphémère |
- | * User Namespaces | + | |
- | * Création d'un Utilisateur Dédié | + | |
- | * Création du Mappage | + | |
- | * Création du Conteneur | + | |
- | * Contrôle du Mappage | + | |
- | * 2.7 - Création d'un Conteneur Éphémère | + | |
* La Commande lxc-copy | * La Commande lxc-copy | ||
- | * 2.8 - Sauvegarde des Conteneurs | + | * 3.7 - Sauvegarde des Conteneurs |
* La Commande lxc-snapshot | * La Commande lxc-snapshot | ||
Ligne 67: | Ligne 68: | ||
=====Présentation des CGroups===== | =====Présentation des CGroups===== | ||
- | Les Groupes de Contrôles (Control Groups) aussi appelés **CGroups**, | + | ====LAB #1 - cgroups v1==== |
- | Les CGroups sont organisés de manière hiérarchique, | + | === 1.1 - Préparation=== |
- | Ces hiérarchies multiples et séparés sont necéssaires parce que chaque hiérarchie est attaché à un ou plusieurs sous-système(s) aussi appelés des **Contrôleurs de Ressources** ou simplement des **Contrôleurs**. Les contrôleurs disponibles sont : | + | Debian 11 utilise cgroups v2 par défault. Pour revenir à l' |
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | root@debian11: | ||
+ | # If you change this file, run ' | ||
+ | # / | ||
+ | # For full documentation of the options in this file, see: | ||
+ | # info -f grub -n ' | ||
+ | |||
+ | GRUB_DEFAULT=0 | ||
+ | GRUB_TIMEOUT=5 | ||
+ | GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` | ||
+ | GRUB_CMDLINE_LINUX_DEFAULT=" | ||
+ | GRUB_CMDLINE_LINUX="" | ||
+ | |||
+ | # Uncomment to enable BadRAM filtering, modify to suit your needs | ||
+ | # This works with Linux (no patch required) and with any kernel that obtains | ||
+ | # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) | ||
+ | # | ||
+ | |||
+ | # Uncomment to disable graphical terminal (grub-pc only) | ||
+ | # | ||
+ | |||
+ | # The resolution used on graphical terminal | ||
+ | # note that you can use only modes which your graphic card supports via VBE | ||
+ | # you can see them in real GRUB with the command `vbeinfo' | ||
+ | # | ||
+ | |||
+ | # Uncomment if you don't want GRUB to pass " | ||
+ | # | ||
+ | |||
+ | # Uncomment to disable generation of recovery mode menu entries | ||
+ | # | ||
+ | |||
+ | # Uncomment to get a beep at grub start | ||
+ | # | ||
+ | |||
+ | root@debian11: | ||
+ | Generating grub configuration file ... | ||
+ | Found background image: / | ||
+ | Found linux image: / | ||
+ | Found initrd image: / | ||
+ | done | ||
+ | </ | ||
+ | |||
+ | Redémarrez ensuite votre VM : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | </ | ||
+ | |||
+ | === 1.2 - Présentation=== | ||
+ | |||
+ | Les **Groupes de Contrôles** (//Control Groups//) aussi appelés **CGroups**, | ||
+ | |||
+ | Les groupes de contrôle sont organisés de manière hiérarchique, | ||
+ | |||
+ | Ces hiérarchies multiples et séparés sont necéssaires parce que chaque hiérarchie est attaché à un ou plusieurs | ||
* **blkio** - utilisé pour établir des limites sur l' | * **blkio** - utilisé pour établir des limites sur l' | ||
* **cpu** - utilisé pour fournir aux tâches des groupes de contrôle accès au CPU grâce au planificateur, | * **cpu** - utilisé pour fournir aux tâches des groupes de contrôle accès au CPU grâce au planificateur, | ||
* **cpuacct** - utilisé pour produire des rapports automatiques sur les ressources CPU utilisées par les tâches dans un groupe de contrôle, | * **cpuacct** - utilisé pour produire des rapports automatiques sur les ressources CPU utilisées par les tâches dans un groupe de contrôle, | ||
- | * **cpuset** - utilisé pour assigner des CPU individuels sur un système | + | * **cpuset** - utilisé pour assigner des CPU individuels sur un système |
* **devices** - utilisé pour autoriser ou pour refuser l' | * **devices** - utilisé pour autoriser ou pour refuser l' | ||
* **freezer** - utilisé pour suspendre ou pour réactiver les tâches dans un groupe de contrôle, | * **freezer** - utilisé pour suspendre ou pour réactiver les tâches dans un groupe de contrôle, | ||
- | * **memory** - utilisé pour établir les limites d' | + | * **memory** - utilisé pour établir les limites d' |
- | * **net_cls** - utilisé pour repérer | + | * **net_cls** - utilisé pour repèrer |
- | * **perf_event** - utilisé pour permettre le monitoring des CGroups avec l' | + | * **perf_event** |
* **hugetlb** - utilisé pour limiter des ressources sur des pages de mémoire virtuelle de grande taille. | * **hugetlb** - utilisé pour limiter des ressources sur des pages de mémoire virtuelle de grande taille. | ||
- | Les hiérarchies ont des points de montage | + | Il est à noter que : |
+ | |||
+ | * chaque processus du système appartient à un cgroup et seulement à un cgroup à la fois, | ||
+ | * tous les threads d'un processus appartiennent au même cgroup, | ||
+ | * à la création d'un processus, celui-ci est mis dans le même cgroup que son processus parent, | ||
+ | * un processus peut être migré d'un cgroup à un autre cgroup. Par contre, la migration d'un processus n'a pas d' | ||
+ | |||
+ | Commencez par installer le paquet | ||
< | < | ||
- | trainee@debian9: | + | root@debian11:~# apt -y install |
- | Mot de passe : fenestros | + | |
- | root@debian9:~# ls -l /sys/fs/cgroup/ | + | |
- | total 0 | + | |
- | dr-xr-xr-x 2 root root 0 mai 26 08:52 blkio | + | |
- | lrwxrwxrwx 1 root root 11 mai 26 08:52 cpu -> cpu, | + | |
- | lrwxrwxrwx 1 root root 11 mai 26 08:52 cpuacct -> cpu, | + | |
- | dr-xr-xr-x 2 root root 0 mai 26 08:52 cpu, | + | |
- | dr-xr-xr-x 2 root root 0 mai 26 08:52 cpuset | + | |
- | dr-xr-xr-x 5 root root 0 mai 26 08:52 devices | + | |
- | dr-xr-xr-x 2 root root 0 mai 26 08:52 freezer | + | |
- | dr-xr-xr-x 2 root root 0 mai 26 08:52 memory | + | |
- | lrwxrwxrwx 1 root root 16 mai 26 08:52 net_cls -> net_cls, | + | |
- | dr-xr-xr-x 2 root root 0 mai 26 08:52 net_cls, | + | |
- | lrwxrwxrwx 1 root root 16 mai 26 08:52 net_prio -> net_cls, | + | |
- | dr-xr-xr-x 2 root root 0 mai 26 08:52 perf_event | + | |
- | dr-xr-xr-x 5 root root 0 mai 26 08:52 pids | + | |
- | dr-xr-xr-x 5 root root 0 mai 26 08:52 systemd | + | |
</ | </ | ||
- | **Systemd** organise les processus dans chaque CGroup. Par exemple tous les processus démarrés par le serveur Apache se trouveront dans le même CGroup, y compris les scripts CGI. Ceci implique que la gestion des ressources en utilisant des hiérarchies est couplé avec l' | + | Pour visualiser les hiérarchies, |
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | cpuset / | ||
+ | cpu,cpuacct / | ||
+ | blkio / | ||
+ | memory / | ||
+ | devices / | ||
+ | freezer / | ||
+ | net_cls, | ||
+ | perf_event / | ||
+ | hugetlb / | ||
+ | pids / | ||
+ | rdma / | ||
+ | </ | ||
+ | |||
+ | Sous Debian 11, **Systemd** organise les processus dans chaque CGroup. Par exemple tous les processus démarrés par le serveur Apache se trouveront dans le même CGroup, y compris les scripts CGI. Ceci implique que la gestion des ressources en utilisant des hiérarchies est couplé avec l' | ||
En haut de l' | En haut de l' | ||
Ligne 123: | Ligne 189: | ||
< | < | ||
- | root@debian9:~# systemctl list-units --type=slice | + | root@debian11:~# systemctl list-units --type=slice |
- | UNIT | + | UNIT |
- | -.slice | + | -.slice |
- | system-getty.slice loaded active active system-getty.slice | + | system-getty.slice |
- | system.slice | + | system-lvm2\x2dpvscan.slice |
- | user-1000.slice | + | |
- | user-112.slice | + | system-systemd\x2dcryptsetup.slice loaded active active Cryptsetup Units Slice |
- | user.slice | + | |
+ | | ||
+ | user.slice | ||
LOAD = Reflects whether the unit definition was properly loaded. | LOAD = Reflects whether the unit definition was properly loaded. | ||
ACTIVE = The high-level unit activation state, i.e. generalization of SUB. | ACTIVE = The high-level unit activation state, i.e. generalization of SUB. | ||
SUB = The low-level unit activation state, values depend on unit type. | SUB = The low-level unit activation state, values depend on unit type. | ||
- | + | 8 loaded units listed. Pass --all to see loaded but inactive units, too. | |
- | 6 loaded units listed. Pass --all to see loaded but inactive units, too. | + | |
To show all installed unit files use ' | To show all installed unit files use ' | ||
</ | </ | ||
Ligne 143: | Ligne 210: | ||
< | < | ||
- | root@debian9:~# systemd-cgls | + | root@debian11:~# systemd-cgls |
Control group /: | Control group /: | ||
-.slice | -.slice | ||
- | ├─user.slice | + | ├─user.slice |
- | │ ├─user-112.slice | + | │ └─user-1000.slice |
- | │ │ ├─user@112.service | + | │ |
- | │ │ │ ├─dbus.service | + | │ │ ├─app.slice |
- | │ │ │ │ └─539 /usr/bin/dbus-daemon | + | │ │ │ ├─pulseaudio.service |
- | │ │ │ ├─init.scope | + | │ |
- | │ │ │ │ ├─527 /lib/systemd/systemd --user | + | │ |
- | │ │ │ │ └─528 (sd-pam) | + | │ |
- | │ │ │ └─gvfs-daemon.service | + | │ |
- | │ │ │ | + | │ |
- | │ │ └─session-c1.scope | + | │ |
- | │ │ | + | │ │ └─init.scope |
- | │ │ | + | │ |
- | │ │ | + | │ │ └─959 (sd-pam) |
- | │ │ ├─541 / | + | │ |
- | │ │ └─543 /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session | + | │ │ ├─ |
- | │ └─user-1000.slice | + | │ │ ├─ |
- | │ | + | │ │ ├─1000 -bash |
- | │ │ ├─668 sshd: trainee [priv] | + | │ │ ├─1003 su - |
- | │ │ ├─679 sshd: trainee@pts/ | + | │ │ ├─1004 -bash |
- | │ │ ├─680 -bash | + | │ │ ├─1010 systemd-cgls |
- | │ │ ├─689 su - | + | │ │ └─1011 less |
- | │ │ ├─690 -su | + | │ |
- | │ │ ├─708 systemd-cgls | + | │ ├─578 /bin/login -p -- |
- | │ │ └─709 systemd-cgls | + | │ |
- | │ | + | │ |
- | │ └─init.scope | + | │ |
- | │ | + | ├─init.scope |
- | │ | + | |
- | ├─init.scope | + | |
│ └─1 /sbin/init | │ └─1 /sbin/init | ||
- | └─system.slice | + | └─system.slice |
- | ├─lightdm.service | + | ├─apache2.service |
- | │ ├─410 /usr/sbin/lightdm | + | │ ├─595 /usr/sbin/apache2 -k start |
- | │ ├─425 /usr/lib/xorg/Xorg :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch | + | │ ├─597 /usr/ |
- | │ └─588 lightdm | + | │ └─598 / |
- | ├─anacron.service | + | ├─systemd-udevd.service |
- | lines 1-39 | + | │ └─317 |
+ | ├─cron.service | ||
+ | │ └─491 / | ||
+ | ├─polkit.service | ||
+ | │ └─495 | ||
+ | ├─rtkit-daemon.service | ||
+ | │ └─979 / | ||
+ | ├─auditd.service | ||
+ | │ └─460 / | ||
+ | ├─wpa_supplicant.service | ||
+ | │ └─498 / | ||
+ | ├─ModemManager.service | ||
+ | │ └─515 | ||
+ | ├─inetd.service | ||
+ | │ └─694 / | ||
+ | ├─systemd-journald.service | ||
+ | │ └─296 / | ||
+ | ├─mdmonitor.service | ||
+ | │ └─432 / | ||
+ | ├─ssh.service | ||
+ | │ └─580 sshd: / | ||
+ | lines 1-58 | ||
+ | [q] | ||
</ | </ | ||
En utilisant Systemd, plusieurs ressources peuvent être limitées : | En utilisant Systemd, plusieurs ressources peuvent être limitées : | ||
- | * **CPUShares** - par défaut | + | * **CPUShares** - par défault |
* **MemoryLimit** - limite exprimée en Mo ou en Go. Pas de valeur par défaut, | * **MemoryLimit** - limite exprimée en Mo ou en Go. Pas de valeur par défaut, | ||
* **BlockIOWeight** - valeur entre 10 et 1000. Pas de valeur par défaut, | * **BlockIOWeight** - valeur entre 10 et 1000. Pas de valeur par défaut, | ||
Ligne 195: | Ligne 282: | ||
* **CPUQuota** - utilisé pour limiter le temps CPU, même quand le système ne fait rien. | * **CPUQuota** - utilisé pour limiter le temps CPU, même quand le système ne fait rien. | ||
- | <WRAP center round important> | + | === 1.3 - Limitation de la Mémoire=== |
- | **Important** : Consultez le manuel systemd.resource-control(5) pour voir les paramètres CGroup qui peuvent être passés à systemctl. | + | |
- | </ | + | |
- | + | ||
- | ====LAB #1 - Travailler avec les CGroups==== | + | |
- | + | ||
- | ===1.1 - Limitation de la Mémoire=== | + | |
- | + | ||
- | Pour travailler avec les CGroups dans Debian 9, il convient d' | + | |
- | + | ||
- | < | + | |
- | root@debian9: | + | |
- | </ | + | |
- | Commencez | + | Commencez par créer le script **hello-world.sh** qui servira à générer un processus pour travailler avec les CGroups : |
< | < | ||
- | root@debian9:~# vi hello-world.sh | + | root@debian11:~# vi hello-world.sh |
- | root@debian9:~# cat hello-world.sh | + | root@debian11:~# cat hello-world.sh |
#!/bin/bash | #!/bin/bash | ||
while [ 1 ]; do | while [ 1 ]; do | ||
- | echo "hello world" | + | |
- | sleep | + | sleep 360 |
done | done | ||
</ | </ | ||
Ligne 224: | Ligne 299: | ||
< | < | ||
- | root@debian9:~# chmod u+x hello-world.sh | + | root@debian11:~# chmod u+x hello-world.sh |
- | root@debian9:~# ./ | + | root@debian11:~# ./ |
- | hello world | + | |
hello world | hello world | ||
^C | ^C | ||
Ligne 234: | Ligne 308: | ||
< | < | ||
- | root@debian9:~# mkdir / | + | root@debian11:~# mkdir / |
</ | </ | ||
Ligne 240: | Ligne 314: | ||
< | < | ||
- | root@debian9:~# echo 40000000 > / | + | root@debian11:~# echo 40000000 > / |
- | root@debian9:~# cat / | + | root@debian11:~# cat / |
39997440 | 39997440 | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** - Notez que les 40 000 000 demandés sont devenus 39 997 440 ce qui correspond à un nombre entier de pages mémoire du noyau de 4Ko. ( 39 997 440 / 4096 = 9 765 ). | **Important** - Notez que les 40 000 000 demandés sont devenus 39 997 440 ce qui correspond à un nombre entier de pages mémoire du noyau de 4Ko. ( 39 997 440 / 4096 = 9 765 ). | ||
</ | </ | ||
Ligne 252: | Ligne 326: | ||
< | < | ||
- | root@debian9:~# ./ | + | root@debian11:~# ./ |
- | [1] 1012 | + | [1] 1073 |
- | root@debian9:~# hello world | + | root@debian11:~# hello world |
+ | [Entrée] | ||
- | root@debian9:~# ps aux | grep hello-world | + | root@debian11:~# ps aux | grep hello-world |
- | root | + | root |
- | root | + | root |
</ | </ | ||
- | Notez l' | + | Notez qu'il n'y a pas de limite de la mémoire, ce qui implique |
< | < | ||
- | root@debian9:~# ps -ww -o cgroup | + | root@debian11:~# ps -ww -o cgroup |
CGROUP | CGROUP | ||
- | 6: | + | 8: |
</ | </ | ||
Ligne 272: | Ligne 347: | ||
< | < | ||
- | root@debian9:~# echo 1012 > / | + | root@debian11:~# echo 1073 > / |
</ | </ | ||
- | Notez maintenant l' | + | Notez maintenant l' |
< | < | ||
- | root@debian9:~# ps -ww -o cgroup | + | root@debian11:~# ps -ww -o cgroup |
CGROUP | CGROUP | ||
- | 6: | + | 8: |
</ | </ | ||
Ligne 286: | Ligne 361: | ||
< | < | ||
- | root@debian9:~# cat / | + | root@debian11:~# cat / |
- | 319488 | + | 274432 |
</ | </ | ||
Ligne 293: | Ligne 368: | ||
< | < | ||
- | root@debian9:~# kill 1012 | + | root@debian11:~# kill 1073 |
- | root@debian9:~# ps aux | grep hello-world | + | root@debian11:~# ps aux | grep hello-world |
- | root | + | root |
- | [1]+ | + | [1]+ |
</ | </ | ||
Ligne 302: | Ligne 377: | ||
< | < | ||
- | root@debian9:~# mkdir / | + | root@debian11:~# mkdir / |
- | root@debian9:~# echo 6000 > / | + | root@debian11:~# echo 6000 > / |
- | root@debian9:~# cat / | + | root@debian11:~# cat / |
4096 | 4096 | ||
</ | </ | ||
Ligne 311: | Ligne 386: | ||
< | < | ||
- | root@debian9:~# ./ | + | root@debian11:~# ./ |
- | [1] 1042 | + | [1] 1089 |
- | root@debian9: | + | |
- | root@debian9:~# echo 1042 > / | + | root@debian11:~# hello world |
+ | [Entrée] | ||
+ | |||
+ | root@debian11:~# echo 1089 > / | ||
</ | </ | ||
Ligne 321: | Ligne 398: | ||
< | < | ||
- | root@debian9:~# hello world | + | root@debian11:~# ps aux | grep hello-world |
- | + | root 1100 0.0 0.0 | |
- | [1]+ | + | [1]+ |
</ | </ | ||
- | Consultez en suite la fin du fichier **/ | + | Notez la trace dans le fichier **/ |
< | < | ||
- | root@debian9:~# tail / | + | root@debian11:~# tail / |
- | Jul 28 10:39:26 debian9 | + | May 4 06:44:43 debian11 |
- | Jul 28 10:39:26 debian9 kernel: [ 1501.775171] | + | May 4 06:44:43 debian11 |
- | Jul 28 10:39:26 debian9 | + | May 4 06:44:43 debian11 |
- | Jul 28 10:39:26 debian9 | + | May 4 06:44:43 debian11 |
- | Jul 28 10:39:26 debian9 | + | May 4 06:44:43 debian11 |
- | Jul 28 10:39:26 debian9 | + | May 4 06:44:43 debian11 |
- | Jul 28 10:39:26 debian9 | + | May 4 06:44:43 debian11 |
- | Jul 28 10:39:26 debian9 | + | May 4 06:44:43 debian11 |
- | Jul 28 10:39:26 debian9 | + | May 4 06:44:43 debian11 |
- | Jul 28 10:39:26 debian9 | + | May 4 06:44:43 debian11 kernel: [ 994.012430] oom-kill: |
</ | </ | ||
- | <WRAP center round important> | + | ===1.4 - La Commande |
- | **Important** - Notez la trace **Task in / | + | |
- | </ | + | |
- | + | ||
- | ===1.2 - Le Paquet cgroup-tools=== | + | |
- | + | ||
- | Le paquet **cgroup-tools** installe des commandes dites //de facilité// dont : | + | |
- | + | ||
- | ==La commande | + | |
Cette commande permet la création d'un CGroup : | Cette commande permet la création d'un CGroup : | ||
< | < | ||
- | root@debian9:~# cgcreate -g memory: | + | root@debian11:~# cgcreate -g memory: |
- | root@debian9:~# ls -l / | + | |
+ | root@debian11:~# ls -l / | ||
total 0 | total 0 | ||
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 cgroup.clone_children | + | -rw-r--r-- 1 root root 0 May 4 06:47 cgroup.clone_children |
- | --w--w--w- 1 root root 0 juil. 28 11:09 cgroup.event_control | + | --w--w--w- 1 root root 0 May 4 06:47 cgroup.event_control |
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 cgroup.procs | + | -rw-r--r-- 1 root root 0 May 4 06:47 cgroup.procs |
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 memory.failcnt | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.failcnt |
- | --w------- 1 root root 0 juil. 28 11:09 memory.force_empty | + | --w------- 1 root root 0 May 4 06:47 memory.force_empty |
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 memory.kmem.failcnt | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.failcnt |
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 memory.kmem.limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.limit_in_bytes |
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 memory.kmem.max_usage_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.max_usage_in_bytes |
- | -r--r--r-- 1 root root 0 juil. 28 11:09 memory.kmem.slabinfo | + | -r--r--r-- 1 root root 0 May 4 06:47 memory.kmem.slabinfo |
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 memory.kmem.tcp.failcnt | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.tcp.failcnt |
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 memory.kmem.tcp.limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.tcp.limit_in_bytes |
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 memory.kmem.tcp.max_usage_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.tcp.max_usage_in_bytes |
- | -r--r--r-- 1 root root 0 juil. 28 11:09 memory.kmem.tcp.usage_in_bytes | + | -r--r--r-- 1 root root 0 May 4 06:47 memory.kmem.tcp.usage_in_bytes |
- | -r--r--r-- 1 root root 0 juil. 28 11:09 memory.kmem.usage_in_bytes | + | -r--r--r-- 1 root root 0 May 4 06:47 memory.kmem.usage_in_bytes |
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 memory.limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.limit_in_bytes |
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 memory.max_usage_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.max_usage_in_bytes |
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 memory.move_charge_at_immigrate | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.memsw.failcnt |
- | -r--r--r-- 1 root root 0 juil. 28 11:09 memory.numa_stat | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.memsw.limit_in_bytes |
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 memory.oom_control | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.memsw.max_usage_in_bytes |
- | ---------- 1 root root 0 juil. 28 11:09 memory.pressure_level | + | -r--r--r-- 1 root root 0 May 4 06:47 memory.memsw.usage_in_bytes |
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 memory.soft_limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.move_charge_at_immigrate |
- | -r--r--r-- 1 root root 0 juil. 28 11:09 memory.stat | + | -r--r--r-- 1 root root 0 May 4 06:47 memory.numa_stat |
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 memory.swappiness | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.oom_control |
- | -r--r--r-- 1 root root 0 juil. 28 11:09 memory.usage_in_bytes | + | ---------- 1 root root 0 May 4 06:47 memory.pressure_level |
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 memory.use_hierarchy | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.soft_limit_in_bytes |
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 notify_on_release | + | -r--r--r-- 1 root root 0 May 4 06:47 memory.stat |
- | -rw-r--r-- 1 root root 0 juil. 28 11:09 tasks | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.swappiness |
+ | -r--r--r-- 1 root root 0 May 4 06:47 memory.usage_in_bytes | ||
+ | -rw-r--r-- 1 root root 0 May 4 06:47 memory.use_hierarchy | ||
+ | -rw-r--r-- 1 root root 0 May 4 06:47 notify_on_release | ||
+ | -rw-r--r-- 1 root root 0 May 4 06:47 tasks | ||
</ | </ | ||
Ligne 390: | Ligne 464: | ||
< | < | ||
- | root@debian9:~# echo 40000000 > / | + | root@debian11:~# echo 40000000 > / |
</ | </ | ||
- | ==La Commande cgexec== | + | ===1.5 - La Commande cgexec=== |
Cette commande permet d' | Cette commande permet d' | ||
< | < | ||
- | root@debian9:~# cgexec -g memory: | + | root@debian11:~# cgexec -g memory: |
- | [2] 1860 | + | [1] 1106 |
- | root@debian9: | + | |
- | root@debian9:~# | + | root@debian11:~# hello world |
+ | [Entrée] | ||
+ | |||
+ | root@debian11: | ||
+ | 1106 | ||
+ | 1107 | ||
+ | root@debian11: | ||
+ | root 1106 0.0 0.0 | ||
+ | root 1107 0.0 0.0 | ||
+ | root 1108 0.0 0.0 0 0 ? I 06:49 0:00 [kworker/ | ||
+ | root 1113 0.0 0.0 | ||
</ | </ | ||
- | == La Commande cgdelete== | + | ===1.6 - La Commande cgdelete== |
Une fois le script terminé, cette commande permet de supprimer le cgroup : | Une fois le script terminé, cette commande permet de supprimer le cgroup : | ||
< | < | ||
- | root@debian9:~# ps aux | grep *.sh | + | root@debian11:~# kill 1106 |
- | root | + | root@debian11:~# ps aux | grep 110 |
- | root | + | root |
- | root@debian9:~# kill 1073 | + | root |
- | root@debian9: | + | root |
- | root 1078 | + | [1]+ |
- | [1]+ | + | |
- | root@debian9:~# cgdelete memory: | + | root@debian11:~# cgdelete memory: |
- | root@debian9:~# ls -l / | + | |
- | ls: impossible d' | + | root@debian11:~# ls -l / |
+ | ls: cannot access | ||
</ | </ | ||
- | ==Le Fichier / | + | ===1.7 - Le Fichier / |
- | Afin de les rendre persistants, | + | Afin de les rendre persistants, |
< | < | ||
- | root@debian9:~# vi / | + | root@debian11:~# vi / |
- | root@debian9:~# cat / | + | root@debian11:~# cat / |
group helloworld2 { | group helloworld2 { | ||
- | cpu { | + | |
- | cpu.shares = 100; | + | cpu.shares = 100; |
- | } | + | } |
- | memory { | + | memory { |
- | memory.limit_in_bytes = 40000; | + | memory.limit_in_bytes = 40000; |
- | } | + | } |
} | } | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
- | **Important** - Notez la création de **deux** limitations, | + | **Important** - Notez la création de **deux** limitations, |
</ | </ | ||
Ligne 446: | Ligne 530: | ||
< | < | ||
- | root@debian9:~# cgcreate -g memory: | + | root@debian11:~# cgcreate -g memory: |
- | root@debian9:~# ls -l / | + | |
+ | root@debian11:~# ls -l / | ||
total 0 | total 0 | ||
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 cgroup.clone_children | + | -rw-r--r-- 1 root root 0 May 4 06:53 cgroup.clone_children |
- | --w--w--w- 1 root root 0 juil. 28 12:47 cgroup.event_control | + | --w--w--w- 1 root root 0 May 4 06:53 cgroup.event_control |
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 cgroup.procs | + | -rw-r--r-- 1 root root 0 May 4 06:53 cgroup.procs |
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 memory.failcnt | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.failcnt |
- | --w------- 1 root root 0 juil. 28 12:47 memory.force_empty | + | --w------- 1 root root 0 May 4 06:53 memory.force_empty |
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 memory.kmem.failcnt | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.failcnt |
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 memory.kmem.limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.limit_in_bytes |
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 memory.kmem.max_usage_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.max_usage_in_bytes |
- | -r--r--r-- 1 root root 0 juil. 28 12:47 memory.kmem.slabinfo | + | -r--r--r-- 1 root root 0 May 4 06:53 memory.kmem.slabinfo |
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 memory.kmem.tcp.failcnt | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.tcp.failcnt |
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 memory.kmem.tcp.limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.tcp.limit_in_bytes |
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 memory.kmem.tcp.max_usage_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.tcp.max_usage_in_bytes |
- | -r--r--r-- 1 root root 0 juil. 28 12:47 memory.kmem.tcp.usage_in_bytes | + | -r--r--r-- 1 root root 0 May 4 06:53 memory.kmem.tcp.usage_in_bytes |
- | -r--r--r-- 1 root root 0 juil. 28 12:47 memory.kmem.usage_in_bytes | + | -r--r--r-- 1 root root 0 May 4 06:53 memory.kmem.usage_in_bytes |
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 memory.limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.limit_in_bytes |
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 memory.max_usage_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.max_usage_in_bytes |
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 memory.move_charge_at_immigrate | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.memsw.failcnt |
- | -r--r--r-- 1 root root 0 juil. 28 12:47 memory.numa_stat | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.memsw.limit_in_bytes |
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 memory.oom_control | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.memsw.max_usage_in_bytes |
- | ---------- 1 root root 0 juil. 28 12:47 memory.pressure_level | + | -r--r--r-- 1 root root 0 May 4 06:53 memory.memsw.usage_in_bytes |
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 memory.soft_limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.move_charge_at_immigrate |
- | -r--r--r-- 1 root root 0 juil. 28 12:47 memory.stat | + | -r--r--r-- 1 root root 0 May 4 06:53 memory.numa_stat |
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 memory.swappiness | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.oom_control |
- | -r--r--r-- 1 root root 0 juil. 28 12:47 memory.usage_in_bytes | + | ---------- 1 root root 0 May 4 06:53 memory.pressure_level |
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 memory.use_hierarchy | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.soft_limit_in_bytes |
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 notify_on_release | + | -r--r--r-- 1 root root 0 May 4 06:53 memory.stat |
- | -rw-r--r-- 1 root root 0 juil. 28 12:47 tasks | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.swappiness |
+ | -r--r--r-- 1 root root 0 May 4 06:53 memory.usage_in_bytes | ||
+ | -rw-r--r-- 1 root root 0 May 4 06:53 memory.use_hierarchy | ||
+ | -rw-r--r-- 1 root root 0 May 4 06:53 notify_on_release | ||
+ | -rw-r--r-- 1 root root 0 May 4 06:53 tasks | ||
</ | </ | ||
< | < | ||
- | root@debian9:~# cgcreate -g cpu: | + | root@debian11:~# cgcreate -g cpu: |
- | root@debian9:~# ls -l / | + | |
+ | root@debian11:~# ls -l / | ||
total 0 | total 0 | ||
- | -rw-r--r-- 1 root root 0 juil. 28 12:48 cgroup.clone_children | + | -rw-r--r-- 1 root root 0 May 4 06:54 cgroup.clone_children |
- | -rw-r--r-- 1 root root 0 juil. 28 12:48 cgroup.procs | + | -rw-r--r-- 1 root root 0 May 4 06:54 cgroup.procs |
- | -r--r--r-- 1 root root 0 juil. 28 12:48 cpuacct.stat | + | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.stat |
- | -rw-r--r-- 1 root root 0 juil. 28 12:48 cpuacct.usage | + | -rw-r--r-- 1 root root 0 May 4 06:54 cpuacct.usage |
- | -r--r--r-- 1 root root 0 juil. 28 12:48 cpuacct.usage_all | + | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_all |
- | -r--r--r-- 1 root root 0 juil. 28 12:48 cpuacct.usage_percpu | + | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_percpu |
- | -r--r--r-- 1 root root 0 juil. 28 12:48 cpuacct.usage_percpu_sys | + | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_percpu_sys |
- | -r--r--r-- 1 root root 0 juil. 28 12:48 cpuacct.usage_percpu_user | + | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_percpu_user |
- | -r--r--r-- 1 root root 0 juil. 28 12:48 cpuacct.usage_sys | + | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_sys |
- | -r--r--r-- 1 root root 0 juil. 28 12:48 cpuacct.usage_user | + | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_user |
- | -rw-r--r-- 1 root root 0 juil. 28 12:48 cpu.cfs_period_us | + | -rw-r--r-- 1 root root 0 May 4 06:54 cpu.cfs_period_us |
- | -rw-r--r-- 1 root root 0 juil. 28 12:48 cpu.cfs_quota_us | + | -rw-r--r-- 1 root root 0 May 4 06:54 cpu.cfs_quota_us |
- | -rw-r--r-- 1 root root 0 juil. 28 12:48 cpu.shares | + | -rw-r--r-- 1 root root 0 May 4 06:54 cpu.shares |
- | -r--r--r-- 1 root root 0 juil. 28 12:48 cpu.stat | + | -r--r--r-- 1 root root 0 May 4 06:54 cpu.stat |
- | -rw-r--r-- 1 root root 0 juil. 28 12:48 notify_on_release | + | -rw-r--r-- 1 root root 0 May 4 06:54 notify_on_release |
- | -rw-r--r-- 1 root root 0 juil. 28 12:48 tasks | + | -rw-r--r-- 1 root root 0 May 4 06:54 tasks |
</ | </ | ||
+ | |||
+ | ===1.8 - La Commande cgconfigparser=== | ||
Appliquez le contenu du fichier **/ | Appliquez le contenu du fichier **/ | ||
< | < | ||
- | root@debian9:~# cgconfigparser -l / | + | root@debian11:~# cgconfigparser -l / |
- | root@debian9:~# cat / | + | |
+ | root@debian11:~# cat / | ||
36864 | 36864 | ||
- | root@debian9:~# cat / | + | |
+ | root@debian11:~# cat / | ||
100 | 100 | ||
</ | </ | ||
- | =====Présentation de Linux Containers===== | + | ====LAB #2 - cgroups v2==== |
- | ====LAB #2 - Travailler avec LXC==== | + | ===2.1 - Préparation=== |
- | ===2.1 - Installation=== | + | Pour revenir à l' |
- | Les outils indispensables à l'utilisation des Linux Containers sous Debian | + | < |
+ | root@debian11: | ||
+ | root@debian11: | ||
+ | # If you change this file, run 'update-grub' | ||
+ | # / | ||
+ | # For full documentation of the options in this file, see: | ||
+ | # info -f grub -n ' | ||
+ | |||
+ | GRUB_DEFAULT=0 | ||
+ | GRUB_TIMEOUT=5 | ||
+ | GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` | ||
+ | GRUB_CMDLINE_LINUX_DEFAULT=" | ||
+ | GRUB_CMDLINE_LINUX="" | ||
+ | |||
+ | # Uncomment to enable BadRAM filtering, modify to suit your needs | ||
+ | # This works with Linux (no patch required) and with any kernel that obtains | ||
+ | # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) | ||
+ | # | ||
+ | |||
+ | # Uncomment to disable graphical terminal (grub-pc only) | ||
+ | # | ||
+ | |||
+ | # The resolution used on graphical terminal | ||
+ | # note that you can use only modes which your graphic card supports via VBE | ||
+ | # you can see them in real GRUB with the command `vbeinfo' | ||
+ | # | ||
+ | |||
+ | # Uncomment if you don't want GRUB to pass " | ||
+ | # | ||
+ | |||
+ | # Uncomment to disable generation of recovery mode menu entries | ||
+ | # | ||
+ | |||
+ | # Uncomment to get a beep at grub start | ||
+ | # | ||
+ | |||
+ | root@debian11: | ||
+ | Generating grub configuration file ... | ||
+ | Found background image: / | ||
+ | Found linux image: / | ||
+ | Found initrd image: / | ||
+ | done | ||
+ | </ | ||
+ | |||
+ | Redémarrez ensuite votre VM : | ||
< | < | ||
- | root@debian9:~# apt update | + | root@debian11:~# reboot |
- | root@debian9: | + | |
</ | </ | ||
- | L'installation | + | ===2.2 - Présentation=== |
+ | |||
+ | A l'opposé des cgroups v1, cgroup v2 n'a qu'une seule arborescence ou hiérarchie et donc un seul point de montage. Tous les contrôleurs compatibles v2 qui ne sont pas liés à une hiérarchie v1 sont automatiquement liés à la hiérarchie v2. Un contrôleur inactif dans la hiérarchie v2 peut être lié à un autre hiérarchie. La migration d'un contrôleur d'une hiérarchie à une autre hiérarchie n'est possible | ||
+ | |||
+ | Pour vérifier l' | ||
< | < | ||
- | root@debian9:~# ls / | + | root@debian11:~# mount -l | grep cgroup |
- | config hooks | + | cgroup2 on /sys/fs/cgroup type cgroup2 (rw, |
- | root@debian9: | + | |
- | alpine.common.conf | + | |
- | alpine.userns.conf | + | |
- | archlinux.common.conf | + | |
- | archlinux.userns.conf | + | |
- | centos.common.conf | + | |
- | root@debian9: | + | |
- | lxc-alpine | + | |
- | lxc-altlinux | + | |
</ | </ | ||
- | ===2.2 - Création d'un Conteneur Simple=== | + | et de consulter le contenu de ce point de montage : |
- | Créez un conteneur simple en utilisant | + | < |
+ | root@debian11: | ||
+ | total 0 | ||
+ | -r--r--r-- | ||
+ | -rw-r--r-- | ||
+ | -rw-r--r-- | ||
+ | -rw-r--r-- | ||
+ | -r--r--r-- | ||
+ | -rw-r--r-- | ||
+ | -rw-r--r-- | ||
+ | -rw-r--r-- | ||
+ | -r--r--r-- | ||
+ | -r--r--r-- | ||
+ | -r--r--r-- | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x | ||
+ | -rw-r--r-- | ||
+ | -rw-r--r-- | ||
+ | -rw-r--r-- | ||
+ | -r--r--r-- | ||
+ | -r--r--r-- | ||
+ | -rw-r--r-- | ||
+ | -r--r--r-- | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x 23 root root 0 Jul 6 11:26 system.slice | ||
+ | drwxr-xr-x | ||
+ | </ | ||
+ | |||
+ | Dans la version 2 de cgroup, certains noms ont changé par rapport à ceux utilisés dans la version 1 : | ||
+ | |||
+ | ^ Version 1 ^ Version 2 ^ | ||
+ | | CPUShares | CPUWeight | | ||
+ | | StartupCPUShares | StartupCPUWeight | | ||
+ | | MemoryLimit | MemoryMax | | ||
+ | |||
+ | Commencez par créer le cgroup enfant **pids** dans le cgroup racine | ||
< | < | ||
- | root@debian9:~# lxc-create -n lxc-bb -t busybox | + | root@debian11:~# mkdir /sys/fs/cgroup/pids |
- | chmod: impossible d' | + | |
- | setting root password to " | + | |
- | Failed to change root password | + | |
</ | </ | ||
- | <WRAP center round important> | + | Placez |
- | **Important** - Notez l' | + | |
- | </ | + | |
- | Le **backingstore** (// méthode de stockage//) utilisé par défaut est **dir** ce qui implique | + | < |
+ | root@debian11: | ||
+ | 1230 | ||
+ | root@debian11: | ||
+ | </ | ||
+ | |||
+ | Contrôlez maintenant le contenu du fichier cgroup.procs ainsi que le nombre de PIDs dans le cgroup | ||
< | < | ||
- | root@debian9:~# ls /var/lib/lxc/ | + | root@debian11:~# cat /sys/fs/cgroup/pids/ |
- | lxc-bb | + | 1230 |
+ | 1281 | ||
- | root@debian9:~# ls /var/lib/lxc/lxc-bb/ | + | root@debian11:~# cat /sys/fs/cgroup/pids/pids.current |
- | config rootfs | + | 2 |
+ | </ | ||
- | root@debian9:~# ls /var/lib/lxc/lxc-bb/rootfs | + | <WRAP center round important 50% > |
- | bin dev etc home lib lib64 mnt proc root sbin selinux | + | **Important** - Notez que le fichier cgroup.procs contient **deux** PIDs. Le premier est celui du Shell tandis que le deuxième est celui de la commande cat. |
+ | </ | ||
+ | |||
+ | Injectez maintenant la valeur de **5** dans le fichier **pids.max** du cgroup ** pids** : | ||
+ | |||
+ | < | ||
+ | root@debian11:~# echo 5 > /sys/fs/cgroup/pids/pids.max | ||
</ | </ | ||
- | Il est à noter que LXC peut également utiliser des backingstores de type : | + | Lancez la commande suivante pour créer 6 pids dans le cgroup |
- | * ZFS | + | < |
- | * Brtfs | + | root@debian11: |
- | * LVM | + | [1] 1290 |
- | * Loop | + | [2] 1291 |
- | * rbd (CephFS) | + | [3] 1292 |
+ | [4] 1293 | ||
+ | -bash: fork: retry: Resource temporarily unavailable | ||
+ | -bash: fork: retry: Resource temporarily unavailable | ||
+ | -bash: fork: retry: Resource temporarily unavailable | ||
+ | -bash: fork: retry: Resource temporarily unavailable | ||
+ | -bash: fork: Resource temporarily unavailable | ||
+ | </ | ||
- | ===2.3 | + | <WRAP center round important 50% > |
+ | **Important** | ||
+ | </ | ||
- | Pour démarrer le conteneur, il convient d' | + | Dernièrement, essayez de supprimer le cgroup |
< | < | ||
- | root@debian9:~# lxc-start --name lxc-bb | + | root@debian11:~# rmdir / |
+ | rmdir: failed to remove '/ | ||
</ | </ | ||
- | ===2.4 | + | <WRAP center round important 50% > |
+ | **Important** | ||
+ | </ | ||
- | Pour s' | + | Déplacez le processus du terminal courant dans le cgroup racine |
< | < | ||
- | root@debian9:~# lxc-attach --name lxc-bb | + | root@debian11:~# echo $$ > / |
+ | </ | ||
+ | Il est maintenant possible de supprimer le cgroup **pids** : | ||
- | BusyBox v1.22.1 (Debian 1:1.22.0-19+b3) built-in shell (ash) | + | < |
- | Enter ' | + | root@debian11: |
+ | root@debian11:~# | ||
+ | </ | ||
- | ~ # passwd | + | ===2.3 - Limitation de la CPU=== |
- | /bin/sh: passwd: not found | + | |
- | ~ # which passwd | + | |
- | ~ # | + | |
- | </ | + | |
- | <WRAP center round important> | + | Il existe deux façons |
- | **Important** - Notez l' | + | |
- | </ | + | |
- | Pour sortir du conteneur, il convient d' | + | |
+ | * un système de limitation basé sur un pourcentage de CPU pour un ou plusieurs processus, | ||
+ | * **CPU weight**, | ||
+ | * un système de limitation basé sur la prioritisassion d'un ou de plusieurs processus par rapports aux autres processus. | ||
+ | |||
+ | Dans l' | ||
+ | |||
+ | Commencez par créer un service appelé **foo** : | ||
< | < | ||
- | ~ # [Ctrl+d] | + | root@debian11: |
- | ~ # root@debian9:~# | + | root@debian11:~# cat / |
+ | [Unit] | ||
+ | Description=The foo service that does nothing useful | ||
+ | After=remote-fs.target nss-lookup.target | ||
+ | |||
+ | [Service] | ||
+ | ExecStart=/ | ||
+ | ExecStop=/ | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
</ | </ | ||
- | Le fait de sortir du conteneur ne l' | + | Démarrez et activez le service |
< | < | ||
- | ~ # root@debian9:~# [Entrée] | + | root@debian11:~# systemctl start foo.service |
- | root@debian9:~# lxc-ls --running | + | root@debian11:~# systemctl enable foo.service |
- | lxc-bb | + | Created symlink / |
- | root@debian9:~# lxc-ls -f --running | + | root@debian11:~# systemctl status foo.service |
- | NAME | + | ● foo.service |
- | lxc-bb RUNNING 0 | + | |
+ | | ||
+ | Main PID: 997 (sha1sum) | ||
+ | | ||
+ | | ||
+ | CPU: 19.114s | ||
+ | | ||
+ | | ||
+ | |||
+ | Jul 06 11:41:18 debian11 systemd[1]: Started The foo service that does nothing useful. | ||
</ | </ | ||
- | ===2.5 - Commandes LXC de Base=== | + | Utilisez la commande **ps** pour voir le pourcentage |
- | ==La Commande lxc-console== | + | < |
+ | root@debian11: | ||
+ | PID COMMAND | ||
+ | 997 sha1sum | ||
+ | </ | ||
- | Pour lancer une console attachée à un TTY dans le conteneur, il convient d' | + | Créez maintenant |
< | < | ||
- | root@debian9:~# lxc-console --name lxc-bb | + | root@debian11:~# vi / |
+ | root@debian11: | ||
+ | [Unit] | ||
+ | Description=The bar service that does nothing useful | ||
+ | After=remote-fs.target nss-lookup.target | ||
- | Connected to tty 1 | + | [Service] |
- | Type <Ctrl+a q> to exit the console, <Ctrl+a Ctrl+a> to enter Ctrl+a itself | + | ExecStart=/ |
+ | ExecStop=/ | ||
- | lxc-bb login: root | + | [Install] |
- | Password: | + | WantedBy=multi-user.target |
- | Login incorrect | + | |
- | lxc-bb login: trainee | + | |
- | Password: | + | |
- | Login incorrect | + | |
- | lxc-bb login: | + | |
</ | </ | ||
- | <WRAP center round important> | + | Démarrez et activez |
- | **Important** - Notez que pour des raisons évidentes, | + | |
- | </ | + | |
- | Pour sortir de la console, il faut utiliser la combinaison de touches **<Ctrl+a> <q>** : | + | <code> |
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | |||
+ | Created symlink / | ||
+ | |||
+ | root@debian11: | ||
+ | ● bar.service - The bar service that does nothing useful | ||
+ | | ||
+ | | ||
+ | Main PID: 1020 (md5sum) | ||
+ | Tasks: 1 (limit: 19155) | ||
+ | | ||
+ | CPU: 15.079s | ||
+ | | ||
+ | | ||
+ | |||
+ | Jul 06 11:45:24 debian11 systemd[1]: Started The bar service that does nothing useful. | ||
+ | </code> | ||
+ | |||
+ | Utilisez la commande | ||
< | < | ||
- | lxc-bb login: [Ctrl+a] [q] root@debian9:~# | + | root@debian11:~# ps -p 1020 -o pid, |
+ | PID COMMAND | ||
+ | 1020 md5sum | ||
</ | </ | ||
- | ==La Commande lxc-stop== | + | Vérifiez maintenant la présence des contrôleurs **cpuset** et **cpu** dans l' |
- | Pour arrêter le conteneur, utilisez la commande | + | < |
+ | root@debian11: | ||
+ | cpuset cpu io memory hugetlb pids rdma | ||
+ | </ | ||
+ | |||
+ | Activez maintenant les deux contrôleurs | ||
< | < | ||
- | root@debian9:~# lxc-ls --running | + | root@debian11:~# cat / |
- | lxc-bb | + | memory pids |
- | root@debian9:~# lxc-stop --name lxc-bb | + | |
- | root@debian9:~# lxc-ls --running | + | root@debian11:~# echo " |
- | root@debian9:~# | + | |
+ | root@debian11:~# echo " | ||
+ | |||
+ | root@debian11:~# cat / | ||
+ | cpuset cpu memory pids | ||
</ | </ | ||
- | ==La Commande lxc-execute== | + | Créez le cgroup **enfant** appelé **FooBar** : |
- | La commande | + | < |
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | total 0 | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:18 cgroup.controllers | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:18 cgroup.events | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 cgroup.freeze | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 cgroup.max.depth | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 cgroup.max.descendants | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 cgroup.procs | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:18 cgroup.stat | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 cgroup.subtree_control | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 cgroup.threads | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 cgroup.type | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 cpu.max | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 cpu.pressure | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 cpuset.cpus | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:18 cpuset.cpus.effective | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 cpuset.cpus.partition | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 cpuset.mems | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:18 cpuset.mems.effective | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:18 cpu.stat | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 cpu.weight | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 cpu.weight.nice | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 io.pressure | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:18 memory.current | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:18 memory.events | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:18 memory.events.local | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 memory.high | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 memory.low | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 memory.max | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 memory.min | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:18 memory.numa_stat | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 memory.oom.group | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 memory.pressure | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:18 memory.stat | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:18 memory.swap.current | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:18 memory.swap.events | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 memory.swap.high | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 memory.swap.max | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:18 pids.current | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:18 pids.events | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:18 pids.max | ||
+ | </ | ||
+ | |||
+ | Activez les contrôleurs | ||
< | < | ||
- | root@debian9:~# lxc-execute -n lxc-bb -- uname -a | + | root@debian11:~# echo " |
- | init.lxc.static: | + | |
- | Linux lxc-bb 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux | + | root@debian11:~# echo " |
- | root@debian9:~# lxc-ls --running | + | |
- | root@debian9:~# | + | root@debian11:~# cat / |
+ | cpuset cpu memory pids | ||
+ | cpuset cpu | ||
</ | </ | ||
- | ==La Commande lxc-info== | + | <WRAP center round important 50% > |
+ | **Important** | ||
+ | </ | ||
- | Cette commande donne des informations sur un conteneur | + | Créez maintenant le répertoire **/ |
< | < | ||
- | root@debian9:~# lxc-info -n lxc-bb | + | root@debian11:~# mkdir / |
- | Name: lxc-bb | + | root@debian11: |
- | State: | + | total 0 |
+ | -r--r--r-- 1 root root 0 Jul 6 12:20 cgroup.controllers | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:20 cgroup.events | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:20 cgroup.freeze | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:20 cgroup.max.depth | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:20 cgroup.max.descendants | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:20 cgroup.procs | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:20 cgroup.stat | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:20 cgroup.subtree_control | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:20 cgroup.threads | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:20 cgroup.type | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:20 cpu.max | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:20 cpu.pressure | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:20 cpuset.cpus | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:20 cpuset.cpus.effective | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:20 cpuset.cpus.partition | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:20 cpuset.mems | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:20 cpuset.mems.effective | ||
+ | -r--r--r-- 1 root root 0 Jul 6 12:20 cpu.stat | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:20 cpu.weight | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:20 cpu.weight.nice | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:20 io.pressure | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 12:20 memory.pressure | ||
</ | </ | ||
- | ==La Commande lxc-freeze== | + | <WRAP center round important 50% > |
+ | **Important** | ||
+ | </ | ||
- | La commande | + | De façon à ce que les deux processus issus des services |
< | < | ||
- | root@debian9:~# lxc-start -n lxc-bb | + | root@debian11:~# echo " |
- | root@debian9:~# lxc-ls --running | + | root@debian11:~# cat / |
- | lxc-bb | + | 1 |
+ | </ | ||
- | root@debian9: | + | <WRAP center round important 50% > |
- | Name: | + | **Important** |
- | State: | + | </ |
- | PID: 3906 | + | |
- | CPU use: 0.00 seconds | + | |
- | BlkIO use: 0 bytes | + | |
- | Memory use: | + | |
- | KMem use: | + | |
- | root@debian9:~# lxc-freeze -n lxc-bb | + | Mettez en place une limitation des ressources de la CPU avec la commande suivante |
- | root@debian9:~# lxc-info -n lxc-bb | + | < |
- | Name: | + | root@debian11:~# echo " |
- | State: | + | |
- | PID: 3906 | + | |
- | CPU use: 0.00 seconds | + | |
- | BlkIO use: 0 bytes | + | |
- | Memory use: | + | |
- | KMem use: | + | |
</ | </ | ||
- | ==La Commande lxc-unfreeze== | + | <WRAP center round important 50% > |
+ | **Important** | ||
+ | </ | ||
- | La commande | + | Ajoutez maintenant les processus des services |
< | < | ||
- | root@debian9: | + | echo " |
- | root@debian9: | + | echo " |
- | Name: | + | |
- | State: | + | |
- | PID: 3906 | + | |
- | CPU use: 0.00 seconds | + | |
- | BlkIO use: 0 bytes | + | |
- | Memory use: | + | |
- | KMem use: | + | |
</ | </ | ||
- | ==Autres Commandes== | + | Vérifiez la prise en compte par le système de la commande précédente : |
- | Les autres commandes dont il faut avoir une connaissance sont : | + | < |
+ | root@debian11:~# cat / | ||
+ | 0::/ | ||
+ | 0::/ | ||
+ | </ | ||
- | ^ Commande ^ Description ^ | + | Dernièrement, utilisez la commande |
- | | lxc-destroy | Permet de détruire complètement un conteneur | | + | |
- | | lxc-autostart | Permet de rebooter, tuer ou arrêter les conteneurs dont le drapeau | + | |
- | | lxc-cgroup | Permet de manipuler à chaud les CGroups | + | |
- | | lxc-device | Permet | + | |
- | | lxc-usernsexec | Permet d'exécuter | + | |
- | | lxc-wait | Permet d' | + | |
- | ===2.6 - Création d'un Conteneur Non-Privilégié=== | + | < |
+ | top - 12:36:33 up 1: | ||
+ | Tasks: 154 total, | ||
+ | %Cpu(s): | ||
+ | MiB Mem : 16007.9 total, | ||
+ | MiB Swap: 975.0 total, | ||
- | ==User Namespaces== | + | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
+ | 997 root 20 | ||
+ | 1020 root 20 | ||
+ | </ | ||
- | Un conteneur privilégié est un conteneur lancé par l' | + | ===2.4 - La Commande systemctl set-property=== |
- | Le mappage d'UID est une fonctionnalité du noyau Linux appelée | + | Comme déjà vu, systemd organise les processus dans des **slices**, par exemple les utilisateurs sont regroupés dans **/ |
- | ==Création d'un Utilisateur Dédié== | + | < |
+ | root@debian11: | ||
+ | total 0 | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:13 cgroup.controllers | ||
+ | -r--r--r-- 1 root root 0 Jul 6 10:58 cgroup.events | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:13 cgroup.freeze | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:13 cgroup.max.depth | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:13 cgroup.max.descendants | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:13 cgroup.procs | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:13 cgroup.stat | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 15:05 cgroup.subtree_control | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:13 cgroup.threads | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:13 cgroup.type | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:13 cpu.max | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:13 cpu.pressure | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:13 cpuset.cpus | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:13 cpuset.cpus.effective | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:13 cpuset.cpus.partition | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:13 cpuset.mems | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:13 cpuset.mems.effective | ||
+ | -r--r--r-- 1 root root 0 Jul 6 10:58 cpu.stat | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:13 cpu.weight | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:13 cpu.weight.nice | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:13 io.pressure | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:13 memory.current | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:13 memory.events | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:13 memory.events.local | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 10:58 memory.high | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 10:58 memory.low | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 10:58 memory.max | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 10:58 memory.min | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:13 memory.numa_stat | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 10:58 memory.oom.group | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:13 memory.pressure | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:13 memory.stat | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:13 memory.swap.current | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:13 memory.swap.events | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:13 memory.swap.high | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 10:58 memory.swap.max | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:13 pids.current | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:13 pids.events | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 10:58 pids.max | ||
+ | drwxr-xr-x 8 root root 0 Jul 6 15:22 user-1000.slice | ||
+ | drwxr-xr-x 5 root root 0 Jul 6 11:41 user-113.slice | ||
+ | </ | ||
- | Commencez par créer l’utilisateur **lxcnp** dédié à la gestion des conteneurs non-privilégiés | + | et les processus d' |
< | < | ||
- | root@debian9:~# useradd | + | root@debian11:~# ls -l /sys/fs/ |
- | root@debian9:~# passwd lxcnp | + | total 0 |
- | Entrez le nouveau mot de passe UNIX : trainee | + | -r--r--r-- 1 root |
- | Retapez le nouveau mot de passe UNIX : trainee | + | -r--r--r-- 1 root root 0 Jul 6 11:30 cgroup.events |
- | passwd: password updated successfully | + | -rw-r--r-- 1 root root 0 Jul 6 16:14 cgroup.freeze |
+ | -rw-r--r-- 1 root root 0 Jul 6 16:14 cgroup.max.depth | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:14 cgroup.max.descendants | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:14 cgroup.procs | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:14 cgroup.stat | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 15:05 cgroup.subtree_control | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:14 cgroup.threads | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:14 cgroup.type | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:14 cpu.pressure | ||
+ | -r--r--r-- 1 root root 0 Jul 6 11:30 cpu.stat | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:14 io.pressure | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:14 memory.current | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:14 memory.events | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:14 memory.events.local | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 11:30 memory.high | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 11:30 memory.low | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 11:30 memory.max | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 11:30 memory.min | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:14 memory.numa_stat | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 11:30 memory.oom.group | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:14 memory.pressure | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:14 memory.stat | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:14 memory.swap.current | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:14 memory.swap.events | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 16:14 memory.swap.high | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 11:30 memory.swap.max | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:14 pids.current | ||
+ | -r--r--r-- 1 root root 0 Jul 6 16:14 pids.events | ||
+ | -rw-r--r-- 1 root root 0 Jul 6 11:30 pids.max | ||
+ | drwxr-xr-x 2 root root 0 Jul 6 14:56 session-13.scope | ||
+ | drwxr-xr-x 2 root root 0 Jul 6 15:22 session-15.scope | ||
+ | drwxr-xr-x 2 root root 0 Jul 6 11:30 session-4.scope | ||
+ | drwxr-xr-x 2 root root 0 Jul 6 12:12 session-6.scope | ||
+ | drwxr-xr-x 4 trainee | ||
+ | drwxr-xr-x 2 root root 0 Jul 6 11:41 user-runtime-dir@1000.service | ||
</ | </ | ||
- | Les informations concernant le mappage | + | De ce fait, il est possible d' |
+ | |||
+ | ==CPU== | ||
< | < | ||
- | root@debian9:~# grep lxcnp /etc/sub{uid, | + | root@debian11:~# systemctl set-property user-1000.slice CPUQuota=40% |
- | /etc/subuid: | + | root@debian11: |
- | /etc/subgid: | + | 40000 100000 |
</ | </ | ||
- | <WRAP center round important> | + | ==Mémoire== |
- | **Important** - Ces informations indiquent | + | |
+ | < | ||
+ | root@debian11: | ||
+ | root@debian11: | ||
+ | 1073741824 | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important | ||
+ | **Important** - Notez que l'utilisation de **MemoryMax** met en place un **hard limit**. Il est aussi possible de mettre en place un **soft limit** en utilisant | ||
</ | </ | ||
- | ==Création du Mappage== | + | =====Présentation de Linux Containers===== |
- | La valeur de **kernel.unprivileged_userns_clone** doit être **1**, or actuellement elle est de **0** : | + | ====LAB #3 - Travailler avec LXC==== |
+ | |||
+ | ===3.1 - Installation=== | ||
+ | |||
+ | Les outils indispensables à l' | ||
< | < | ||
- | root@debian9:~# cat / | + | root@debian11:~# apt install lxc |
+ | Reading package lists... Done | ||
+ | Building dependency tree... Done | ||
+ | Reading state information... Done | ||
+ | The following packages were automatically installed and are no longer required: | ||
+ | libopengl0 linux-headers-5.10.0-15-amd64 linux-headers-5.10.0-15-common | ||
+ | Use 'apt autoremove' | ||
+ | The following additional packages will be installed: | ||
+ | arch-test bridge-utils busybox-static cloud-image-utils debootstrap distro-info | ||
+ | fakechroot genisoimage libaio1 libdistro-info-perl libfakechroot liblxc1 | ||
+ | libpam-cgfs lxc-templates lxcfs mmdebstrap qemu-utils rsync uidmap uuid-runtime | ||
+ | Suggested packages: | ||
+ | ubuntu-archive-keyring squid-deb-proxy-client shunit2 wodim cdrkit-doc btrfs-progs | ||
+ | lvm2 python3-lxc qemu-user-static apt-transport-tor binfmt-support perl-doc proot | ||
+ | qemu-user squashfs-tools-ng qemu-block-extra | ||
+ | The following packages will be REMOVED: | ||
+ | busybox | ||
+ | The following NEW packages will be installed: | ||
+ | arch-test bridge-utils busybox-static cloud-image-utils debootstrap distro-info | ||
+ | fakechroot genisoimage libaio1 libdistro-info-perl libfakechroot liblxc1 | ||
+ | libpam-cgfs lxc lxc-templates lxcfs mmdebstrap qemu-utils rsync uidmap | ||
+ | uuid-runtime | ||
+ | 0 upgraded, 21 newly installed, 1 to remove and 5 not upgraded. | ||
+ | Need to get 6,127 kB of archives. | ||
+ | After this operation, 33.2 MB of additional disk space will be used. | ||
+ | Do you want to continue? [Y/n] y | ||
</ | </ | ||
- | Fixez donc la valeur à **1** et appliquez la modification avec la commande | + | L' |
< | < | ||
- | root@debian9:~# echo " | + | root@debian11:~# ls /usr/share/lxc |
- | root@debian9:~# cat /etc/sysctl.d/80-lxc-userns.conf | + | config |
- | kernel.unprivileged_userns_clone=1 | + | |
- | root@debian9: | + | root@debian11:~# ls /usr/share/lxc/config |
- | * Applying /etc/sysctl.d/80-lxc-userns.conf ... | + | alpine.common.conf |
- | kernel.unprivileged_userns_clone = 1 | + | alpine.userns.conf |
- | * Applying /etc/sysctl.d/99-sysctl.conf ... | + | archlinux.common.conf |
- | * Applying /etc/sysctl.conf ... | + | archlinux.userns.conf |
+ | centos.common.conf | ||
+ | centos.userns.conf | ||
+ | common.conf openwrt.common.conf | ||
+ | common.conf.d | ||
+ | common.seccomp | ||
+ | debian.common.conf plamo.common.conf | ||
+ | debian.userns.conf | ||
+ | fedora.common.conf | ||
+ | fedora.userns.conf | ||
+ | gentoo.common.conf | ||
+ | |||
+ | root@debian11: | ||
+ | lxc-alpine | ||
+ | lxc-altlinux | ||
+ | lxc-archlinux | ||
+ | lxc-busybox | ||
+ | lxc-centos | ||
</ | </ | ||
- | Connectez-vous ensuite en tant que l'utilisateur **lxcnp** | + | ===3.2 |
+ | |||
+ | Créez un conteneur simple en utilisant la commande suivante | ||
< | < | ||
- | root@debian9:~# su - lxcnp | + | root@debian11:~# lxc-create -n lxc-bb -t busybox |
- | lxcnp@debian9: | + | |
</ | </ | ||
- | Créez | + | <WRAP center round important 50%> |
+ | **Important** - Notez l' | ||
+ | </ | ||
+ | |||
+ | Le **backingstore** (// méthode de stockage//) utilisé par défaut est **dir** ce qui implique que le **rootfs** du conteneur se trouve sur disque dans le répertoire **/var/lib/lxc/** : | ||
< | < | ||
- | lxcnp@debian9:~$ mkdir -p ~/.config/lxc | + | root@debian11:~# ls / |
+ | lxc-bb | ||
+ | |||
+ | root@debian11: | ||
+ | config | ||
+ | |||
+ | root@debian11: | ||
+ | bin dev etc home lib lib64 mnt proc root sbin selinux | ||
</ | </ | ||
- | Créez trois entrées dans le fichier | + | Il est à noter que LXC peut également utiliser des backingstores de type : |
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | * rbd (CephFS) | ||
+ | |||
+ | ===3.3 - Démarrage | ||
+ | |||
+ | Pour démarrer le conteneur, il convient d' | ||
< | < | ||
- | lxcnp@debian9:~$ echo "lxc.include = /etc/lxc/default.conf" | + | root@debian9:~# lxc-start --name |
+ | </code> | ||
- | lxcnp@debian9: | + | ===3.4 - S' |
- | lxcnp@debian9:~$ echo " | + | Pour s' |
- | lxcnp@debian9:~$ cat ~/.config/lxc/ | + | < |
- | lxc.include = /etc/lxc/default.conf | + | root@debian11:~# lxc-start --name lxc-bb |
- | lxc.id_map = u 0 165536 65536 | + | |
- | lxc.id_map = g 0 165536 65536 | + | root@debian11: |
+ | lxc-attach: lxc-bb: terminal.c: lxc_terminal_create_native: | ||
+ | |||
+ | |||
+ | BusyBox v1.30.1 (Debian 1: | ||
+ | Enter ' | ||
+ | |||
+ | ~ # which passwd | ||
+ | /bin/passwd | ||
+ | ~ # | ||
+ | </code> | ||
+ | |||
+ | <WRAP center round important 50%> | ||
+ | **Important** - Notez l' | ||
+ | </ | ||
+ | |||
+ | Pour sortir du conteneur, il convient d' | ||
+ | |||
+ | < | ||
+ | ~ # [Ctrl+d] | ||
+ | ~ # root@debian11: | ||
</ | </ | ||
- | Déconnectez-vous et reconnectez-vous en tant que l'utilisateur | + | Le fait de sortir du conteneur ne l'arrête pas pour autant, comme il peut être constaté par l' |
< | < | ||
- | lxcnp@debian9:~$ exit | + | ~ # root@debian11:~# [Enter] |
- | déconnexion | + | |
- | root@debian9:~# su - lxcnp | + | root@debian11:~# lxc-ls --running |
- | lxcnp@debian9:~$ | + | lxc-bb |
+ | |||
+ | root@debian11:~# lxc-ls -f --running | ||
+ | NAME | ||
+ | lxc-bb RUNNING 0 | ||
</ | </ | ||
- | ==Création du Conteneur== | + | ===3.5 - Commandes LXC de Base=== |
- | Créez maintenant | + | ==La Commande lxc-console== |
+ | |||
+ | Pour lancer une console attachée à un TTY dans le conteneur, il convient d' | ||
< | < | ||
- | lxcnp@debian9:~$ lxc-create | + | root@debian11:~# lxc-console |
- | WARN: could not reopen tty: Permission denied | + | |
- | WARN: could not reopen tty: Permission denied | + | |
- | WARN: could not reopen tty: Permission denied | + | |
- | WARN: could not reopen tty: Permission denied | + | |
- | WARN: could not reopen tty: Permission denied | + | |
- | WARN: could not reopen tty: Permission denied | + | |
- | WARN: could not reopen tty: Permission denied | + | |
- | WARN: could not reopen tty: Permission denied | + | |
- | WARN: could not reopen tty: Permission denied | + | |
- | WARN: could not reopen tty: Permission denied | + | |
- | WARN: could not reopen tty: Permission denied | + | |
- | WARN: could not reopen tty: Permission denied | + | |
- | chmod: impossible d' | + | |
- | setting root password to " | + | |
- | Failed to change root password | + | |
- | lxcnp@debian9: | + | Connected to tty 1 |
- | total 60 | + | Type <Ctrl+a q> to exit the console, <Ctrl+a Ctrl+a> to enter Ctrl+a itself |
- | drwxr-xr-x 2 165536 165536 4096 juil. 29 13:11 bin | + | |
- | drwxr-xr-x 4 165536 165536 4096 juil. 29 13:11 dev | + | lxc-bb login: |
- | drwxr-xr-x 3 165536 165536 4096 juil. 29 13:11 etc | + | |
- | drwxr-xr-x 2 165536 165536 4096 juil. 29 13:11 home | + | |
- | drwxr-xr-x 2 165536 165536 4096 juil. 29 13:11 lib | + | |
- | drwxr-xr-x 2 165536 165536 4096 juil. 29 13:11 lib64 | + | |
- | drwxr-xr-x 2 165536 165536 4096 juil. 29 13:11 mnt | + | |
- | drwxr-xr-x 2 165536 165536 4096 juil. 29 13:11 proc | + | |
- | drwxr-xr-x 2 165536 165536 4096 juil. 29 13:11 root | + | |
- | drwxr-xr-x 2 165536 165536 4096 juil. 29 13:11 sbin | + | |
- | drwxr-xr-x 2 165536 165536 4096 juil. 29 13:11 selinux | + | |
- | drwxr-xr-x 2 165536 165536 4096 juil. 29 13:11 sys | + | |
- | drwxr-xr-x 2 165536 165536 4096 juil. 29 13:11 tmp | + | |
- | drwxr-xr-x 7 165536 165536 4096 juil. 29 13:11 usr | + | |
- | drwxr-xr-x 3 165536 165536 4096 juil. 29 13:11 var | + | |
</ | </ | ||
- | ==Contrôle du Mappage== | + | Pour sortir de la console, il faut utiliser la combinaison de touches **< |
- | Démarrez | + | < |
+ | lxc-bb login: [Ctrl+a] [q] root@debian11: | ||
+ | </ | ||
+ | |||
+ | ==La Commande lxc-stop== | ||
+ | |||
+ | Pour arrêter | ||
< | < | ||
- | lxcnp@debian9:~$ lxc-start -n lxc-bb-np | + | root@debian11:~# lxc-ls --running |
- | lxcnp@debian9:~$ lxc-ls -f --running | + | lxc-bb |
- | NAME STATE | + | |
- | lxc-bb-np RUNNING 0 | + | root@debian11:~# lxc-stop --name lxc-bb |
+ | |||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
</ | </ | ||
- | Attachez-vous au conteneur | + | ==La Commande lxc-execute== |
+ | |||
+ | La commande **lxc-execute** démarre un conteneur | ||
< | < | ||
- | lxcnp@debian9:~$ lxc-attach | + | root@debian11:~# lxc-execute |
- | WARN: could not reopen tty: Permission denied | + | Linux lxc-bb 5.10.0-24-amd64 #1 SMP Debian 5.10.179-5 (2023-08-08) x86_64 GNU/Linux |
- | WARN: could not reopen tty: Permission denied | + | |
- | WARN: could not reopen tty: Permission denied | + | |
+ | root@debian11: | ||
- | BusyBox v1.22.1 (Debian 1:1.22.0-19+b3) built-in shell (ash) | + | root@debian11:~# |
- | Enter ' | + | </ |
- | / # ps aux | + | ==La Commande lxc-info== |
- | PID | + | |
- | 1 root init | + | Cette commande donne des informations sur un conteneur : |
- | 4 root / | + | |
- | | + | < |
- | 8 root init | + | root@debian11: |
- | 9 root / | + | Name: |
- | 10 root ps aux | + | State: |
- | / # | + | |
</ | </ | ||
- | Détachez-vous du conteneur et sortez du compte | + | ==La Commande lxc-freeze== |
+ | |||
+ | La commande | ||
< | < | ||
- | / # exit | + | root@debian11: |
- | lxcnp@debian9:~$ exit | + | |
- | déconnexion | + | root@debian11:~# lxc-ls --running |
- | root@debian9:~# | + | lxc-bb |
+ | |||
+ | root@debian11: | ||
+ | Name: | ||
+ | State: | ||
+ | PID: 28581 | ||
+ | IP: | ||
+ | Link: | ||
+ | TX bytes: | ||
+ | RX bytes: | ||
+ | Total bytes: | ||
+ | |||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | Name: | ||
+ | State: | ||
+ | PID: 28581 | ||
+ | IP: | ||
+ | Link: | ||
+ | TX bytes: | ||
+ | RX bytes: | ||
+ | Total bytes: | ||
+ | |||
+ | root@debian11:~# | ||
</ | </ | ||
- | Dernièrement, | + | ==La Commande lxc-unfreeze== |
+ | |||
+ | La commande **lxc-unfreeze** annule | ||
< | < | ||
- | root@debian9:~# ps aux | grep 165536 | + | root@debian11:~# lxc-unfreeze -n lxc-bb |
- | 165536 | + | |
- | 165536 | + | root@debian11:~# lxc-info -n lxc-bb |
- | 165536 | + | Name: lxc-bb |
- | 165536 | + | State: |
- | root 3485 0.0 0.0 12784 932 pts/0 S+ 13:22 | + | PID: 28581 |
+ | IP: 10.0.3.65 | ||
+ | Link: vethcJlTVk | ||
+ | TX bytes: 1.22 KiB | ||
+ | RX bytes: | ||
+ | Total bytes: 5.69 KiB | ||
</ | </ | ||
- | ===2.7 - Création d'un Conteneur Éphémère=== | + | ==Autres Commandes== |
+ | |||
+ | Les autres commandes dont il faut avoir une connaissance sont : | ||
+ | |||
+ | ^ Commande ^ Description ^ | ||
+ | | lxc-destroy | Permet de détruire complètement un conteneur | | ||
+ | | lxc-autostart | Permet de rebooter, tuer ou arrêter les conteneurs dont le drapeau **lxc.start.auto** est fixé dans le fichier **/ | ||
+ | | lxc-cgroup | Permet de manipuler à chaud les CGroups pour un conteneur donné | | ||
+ | | lxc-device | Permet de rajouter à chaud les devices à un conteneur | | ||
+ | | lxc-usernsexec | Permet d' | ||
+ | | lxc-wait | Permet d' | ||
+ | |||
+ | ===3.6 - Création d'un Conteneur Éphémère=== | ||
Par défaut les conteneurs LXC sont permanents. Il est possible de créer un conteneur éphémère, | Par défaut les conteneurs LXC sont permanents. Il est possible de créer un conteneur éphémère, | ||
Ligne 942: | Ligne 1466: | ||
< | < | ||
- | root@debian9:~# lxc-ls -f --running | + | root@debian11:~# lxc-ls -f --running |
- | NAME | + | NAME |
- | lxc-bb RUNNING 0 | + | lxc-bb RUNNING 0 |
+ | |||
+ | root@debian11: | ||
- | root@debian9:~# lxc-copy -e -N lxc-bb-eph -n lxc-bb | + | root@debian11:~# lxc-ls -f --running |
- | lxc-copy: lxccontainer.c: | + | |
+ | root@debian11:~# | ||
</ | </ | ||
Ligne 953: | Ligne 1480: | ||
< | < | ||
- | root@debian9:~# lxc-stop -n lxc-bb | + | root@debian11:~# lxc-stop -n lxc-bb |
- | root@debian9:~# lxc-ls -f --running | + | |
- | root@debian9:~# lxc-copy -e -N lxc-bb-eph -n lxc-bb | + | root@debian11:~# lxc-ls -f --running |
+ | |||
+ | root@debian11:~# lxc-copy -e -N lxc-bb-eph -n lxc-bb | ||
Created lxc-bb-eph as clone of lxc-bb | Created lxc-bb-eph as clone of lxc-bb | ||
+ | |||
+ | root@debian11: | ||
+ | NAME | ||
+ | lxc-bb-eph RUNNING 0 | ||
</ | </ | ||
Ligne 962: | Ligne 1495: | ||
< | < | ||
- | root@debian9:~# lxc-attach lxc-bb-eph | + | root@debian11:~# lxc-ls -f --running |
- | lxc-attach: missing container name, use --name option | + | NAME |
- | root@debian9:~# lxc-attach -n lxc-bb-eph | + | lxc-bb-eph RUNNING 0 - |
+ | root@debian11:~# lxc-attach | ||
+ | lxc-attach: | ||
- | BusyBox v1.22.1 (Debian 1:1.22.0-19+b3) built-in shell (ash) | + | BusyBox v1.30.1 (Debian 1:1.30.1-6+b3) built-in shell (ash) |
Enter ' | Enter ' | ||
Ligne 977: | Ligne 1512: | ||
< | < | ||
~ # ls -l | ~ # ls -l | ||
- | total 4 | + | total 0 |
- | -rw-r--r-- | + | |
~ # pwd | ~ # pwd | ||
/root | /root | ||
+ | |||
~ # echo " | ~ # echo " | ||
+ | |||
~ # ls -l | ~ # ls -l | ||
- | total 8 | + | total 4 |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | |
~ # | ~ # | ||
</ | </ | ||
Ligne 994: | Ligne 1531: | ||
~ # exit | ~ # exit | ||
- | root@debian9:~# lxc-attach -n lxc-bb-eph | + | root@debian11:~# lxc-attach -n lxc-bb-eph |
+ | lxc-attach: lxc-bb-eph: terminal.c: lxc_terminal_create_native: | ||
- | BusyBox v1.22.1 (Debian 1:1.22.0-19+b3) built-in shell (ash) | + | BusyBox v1.30.1 (Debian 1:1.30.1-6+b3) built-in shell (ash) |
Enter ' | Enter ' | ||
~ # ls -l | ~ # ls -l | ||
- | total 8 | + | total 4 |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | |
- | ~ # | + | ~ # |
</ | </ | ||
Ligne 1016: | Ligne 1554: | ||
~ # exit | ~ # exit | ||
- | root@debian9:~# lxc-stop -n lxc-bb-eph | + | root@debian11:~# lxc-stop -n lxc-bb-eph |
- | root@debian9:~# lxc-ls | + | root@debian11:~# lxc-ls |
lxc-bb | lxc-bb | ||
- | root@debian9:~# lxc-start -n lxc-bb-eph | + | root@debian11:~# lxc-start -n lxc-bb-eph |
- | lxc-start: | + | lxc-start: lxc-bb-eph: tools/ |
- | lxc-start: tools/ | + | |
+ | root@debian11: | ||
</ | </ | ||
Ligne 1030: | Ligne 1569: | ||
</ | </ | ||
- | ===2.8 - Sauvegarde des Conteneurs=== | + | ===3.7 - Sauvegarde des Conteneurs=== |
Un conteneur LXC peut être sauvegardé de trois façons différentes : | Un conteneur LXC peut être sauvegardé de trois façons différentes : | ||
Ligne 1043: | Ligne 1582: | ||
< | < | ||
- | root@debian9:~# lxc-ls -f --running | + | root@debian11:~# lxc-ls -f --running |
- | root@debian9:~# lxc-snapshot -n lxc-bb | + | root@debian11:~# lxc-snapshot -n lxc-bb |
- | lxc-snapshot: | + | |
- | lxc-snapshot: lxccontainer.c: | + | root@debian11:~# |
- | lxc-snapshot: | + | |
- | lxc-snapshot: | + | |
</ | </ | ||
Ligne 1055: | Ligne 1592: | ||
< | < | ||
- | root@debian9:~# ls -l / | + | root@debian11:~# ls -l / |
total 12 | total 12 | ||
- | -rw-r--r-- 1 root root 1102 juil. 28 13:04 config | + | -rw-r----- 1 root root 1276 Aug 20 10:01 config |
- | -rw-r--r-- | + | drwxr-xr-x 17 root root 4096 Aug 20 10:38 rootfs |
- | drwxr-xr-x 17 root root 4096 juil. 28 15:50 rootfs | + | drwxr-xr-x |
- | drwxr-xr-x | + | |
- | root@debian9:~# ls -l / | + | root@debian11:~# ls -l / |
total 4 | total 4 | ||
- | drwxrwx--- 3 root root 4096 juil. 29 17:34 snap0 | + | drwxrwx--- 3 root root 4096 Aug 20 12:35 snap0 |
- | root@debian9:~# ls -l / | + | root@debian11:~# ls -l / |
total 12 | total 12 | ||
- | -rw-r--r-- 1 root root 1110 juil. 29 17:34 config | + | -rw-r----- 1 root root 1284 Aug 20 12:35 config |
- | drwxr-xr-x 17 root root 4096 juil. 28 15:50 rootfs | + | drwxr-xr-x 17 root root 4096 Aug 20 10:38 rootfs |
- | -rw-r--r-- | + | -rw-r--r-- |
</ | </ | ||
Ligne 1076: | Ligne 1612: | ||
< | < | ||
- | root@debian9:~# cat / | + | root@debian11:~# cat / |
- | 2020:07:29 17:34:36root@debian9:~# | + | 2023:08:20 12:35:35root@debian11:~# |
</ | </ | ||
Ligne 1083: | Ligne 1619: | ||
< | < | ||
- | root@debian9:~# du -sh / | + | root@debian11:~# du -sh / |
- | 792K / | + | 2.1M |
- | root@debian9:~# du -sh / | + | root@debian11:~# du -sh / |
- | 792K / | + | 2.1M |
</ | </ | ||
Ligne 1093: | Ligne 1629: | ||
< | < | ||
- | root@debian9:~# lxc-snapshot -r snap0 -n lxc-bb -N lxc-bb-snap0 | + | root@debian11:~# lxc-snapshot -r snap0 -n lxc-bb -N lxc-bb-snap0 |
- | root@debian9:~# lxc-ls | + | root@debian11:~# lxc-ls |
lxc-bb | lxc-bb | ||
- | root@debian9:~# lxc-start -n lxc-bb-snap0 | + | root@debian11:~# lxc-start -n lxc-bb-snap0 |
- | root@debian9:~# lxc-attach -n lxc-bb-snap0 | + | root@debian11:~# lxc-attach -n lxc-bb-snap0 |
+ | lxc-attach: lxc-bb-snap0: | ||
- | BusyBox v1.22.1 (Debian 1:1.22.0-19+b3) built-in shell (ash) | + | BusyBox v1.30.1 (Debian 1:1.30.1-6+b3) built-in shell (ash) |
Enter ' | Enter ' | ||
~ # exit | ~ # exit | ||
- | root@debian9: | ||
- | </ | ||
- | |||
+ | root@debian11: | ||
+ | </ | ||
----- | ----- | ||
- | < | + | |
- | <div align=" | + | Copyright © 2024 Hugh Norris. |
- | Copyright © 2021 Hugh Norris | + | |
- | </ | + | |
- | </ | + |