Vous êtes sur la page 1sur 44

Systemd

Rihem Ben Romdhane

TEK-UP

November 3, 2022

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 1 / 44
Sommaire

1 Introduction

2 Architecture de systemd

3 Sécurité

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 2 / 44
Introduction

Introduction

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 3 / 44
Introduction

Introduction

systemd est une suite logicielle qui fournit une gamme de composants système
pour les systèmes d’exploitation Linux :
Le système d’initialisation (une alternative à SysV init):
Offre un meilleur cadre pour la gestion des dépendances entre services
Permet le chargement en parallèle des services au démarrage et de réduire les
appels aux scripts shell.
Des divers daemons et utilitaires pour
la gestion des périphériques
la gestion des connexions des utilisateurs
la gestion des connexions réseau
la journalisation des événements

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 4 / 44
Architecture de systemd

Architecture de systemd

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 5 / 44
Architecture de systemd

Systemd

Nouveau système de gestion du système pour Linux:


Parallèle –> démarrage rapide
Dynamique –> ajout retrait matériel à chaud
Sécurisé –> gère cgroups, chroot, containers,...

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 6 / 44
Architecture de systemd

Parallélisation

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 7 / 44
Architecture de systemd

Parallélisation : Exemple

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 8 / 44
Architecture de systemd

Les composants de systemd

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 9 / 44
Architecture de systemd

Différents types d’unités

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 10 / 44
Architecture de systemd

La syntaxe des fichiers service

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 11 / 44
Architecture de systemd

La syntaxe des fichiers service

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 12 / 44
Architecture de systemd

La syntaxe des fichiers service

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 13 / 44
Architecture de systemd

La syntaxe des fichiers service

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 14 / 44
Architecture de systemd

Manipulation des unités

systemctl list-units
systemctl list-units -t service
systemctl list-unit-files -a
systemctl list-unit-files -a -t service

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 15 / 44
Architecture de systemd

La syntaxe des fichiers .socket

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 16 / 44
Architecture de systemd

La syntaxe des fichiers .socket

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 17 / 44
Architecture de systemd

La syntaxe des fichiers .socket

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 18 / 44
Architecture de systemd

La syntaxe des fichiers .socket

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 19 / 44
Architecture de systemd

Les cibles

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 20 / 44
Architecture de systemd

Les cibles

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 21 / 44
Architecture de systemd

Les cibles

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 22 / 44
Architecture de systemd

Les cibles

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 23 / 44
Architecture de systemd

Les cibles

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 24 / 44
Architecture de systemd

Les cibles

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 25 / 44
Architecture de systemd

Que lance la cible /etc/systemd/default.target ?

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 26 / 44
Architecture de systemd

Que lance la cible /etc/systemd/default.target ?

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 27 / 44
Architecture de systemd

Création d’un service : Exemple serveur nbd

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 28 / 44
Sécurité

Sécurité

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 29 / 44
Sécurité

Utilisation des cgroups

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 30 / 44
Sécurité

Utilisation des cgroups

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 31 / 44
Sécurité

Utilisation des cgroups: systemd-cgls

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 32 / 44
Sécurité

Utilisation des cgroups: systemd-cgls

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 33 / 44
Sécurité

Utilisation des cgroups: systemd-cgtop

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 34 / 44
Sécurité

Utilisation des cgroups

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 35 / 44
Sécurité

Lancer un service dans un chroot

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 36 / 44
Sécurité

Utiliser les espaces de nommage

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 37 / 44
Sécurité

Utiliser les espaces de nommage

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 38 / 44
Sécurité

Système de Logs

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 39 / 44
Sécurité

L’outil de contrôle Systemctl

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 40 / 44
Sécurité

L’outil de contrôle Systemctl

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 41 / 44
Sécurité

Récap

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 42 / 44
Sécurité

Récap

Pour plus d’info, voir ce lien


https://linux-note.com/systemd-documentation/

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 43 / 44
Sécurité

Thank you!

. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Rihem Ben Romdhane TEK-UP November 3, 2022 44 / 44

Vous aimerez peut-être aussi