Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
elearning:workbooks:debian:10:junior:l116 [2022/04/29 07:57] – created admin | elearning:workbooks:debian:10:junior:l116 [2024/10/15 14:20] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
+ | |||
+ | Version : **2024.01** | ||
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
- | ======LDF210 | + | ======LDF510 |
=====Contenu du Module===== | =====Contenu du Module===== | ||
- | * **LDF210 | + | * **LDF510 |
* Contenu du Module | * Contenu du Module | ||
* Présentation | * Présentation | ||
Ligne 19: | Ligne 21: | ||
* La Commande LILO | * La Commande LILO | ||
* Codes Erreur de LILO | * Codes Erreur de LILO | ||
- | * GRUB 2 sous Debian 8 | + | * GRUB 2 |
* Le fichier / | * Le fichier / | ||
* Le fichier / | * Le fichier / | ||
* Les fichiers du répertoire /etc/grub.d | * Les fichiers du répertoire /etc/grub.d | ||
- | * Configurer l' | ||
* Modifier la Configuration de GRUB 2 en Ligne de Commande | * Modifier la Configuration de GRUB 2 en Ligne de Commande | ||
* Gestionnaires de Démarrages Alternatifs | * Gestionnaires de Démarrages Alternatifs | ||
Ligne 34: | Ligne 35: | ||
* PXELINUX | * PXELINUX | ||
* Isodhpfx | * Isodhpfx | ||
- | * Initramfs | + | * Initramfs |
- | * Examiner l' | + | * LAB #1 - Travailler avec Initramfs |
- | * Le script init | + | * 1.1 - Examiner l' |
- | | + | * 1.2 - La Commande mkinitramfs |
* Processus de Démarrage du Noyau Linux | * Processus de Démarrage du Noyau Linux | ||
- | * Processus Init | + | * systemd |
- | * Démarrer Debian 6 avec SysVinit | + | * LAB #2 - La Commande systemctl |
- | * Niveaux d' | + | * LAB #3 - Fichiers de Configuration |
- | * Inittab | + | * 3.1 - Fichiers |
- | * Scripts | + | * 3.2 - Surchargement des Fichiers par Défaut |
- | * Le script rc.S sous Debian 6 | + | * 3.3 - Les Fichiers |
- | * Répertoire init.d | + | * LAB #4 - La Commande systemd-analyze |
- | * Linux Standard Base | + | * LAB #5 - Les Cibles |
- | * Codes Retour Standardisés | + | * 5.1 - Contrôler les dépendances |
- | * Scripts | + | * 5.2 - La Cible par Défaut |
- | * Répertoires rcx.d | + | * LAB #6 - Gestion des Services |
- | * rc.local | + | * 6.1 - Gestion des Instances Uniques |
- | * La Commande chkconfig | + | * 6.2 - Gestion d' |
- | * La Commande update-rc.d sous Debian | + | * 6.3 - Interdire la Modification du Statut d'un Service |
- | * Démarrer Debian 8 avec systemd | + | |
- | * La Commande systemctl | + | |
- | * Fichiers de Configuration | + | |
- | * Système de Démarrage | + | |
- | * La Commande systemd-analyze | + | |
- | * Gestion des Services | + | |
* Arrêt Système du Système | * Arrêt Système du Système | ||
* La Commande shutdown | * La Commande shutdown | ||
Ligne 173: | Ligne 168: | ||
</ | </ | ||
- | ====GRUB 2 sous Debian 8==== | + | ====GRUB 2==== |
GRUB 2 est une ré-écriture complète de GRUB Legacy. Il apporte des améliorations, | GRUB 2 est une ré-écriture complète de GRUB Legacy. Il apporte des améliorations, | ||
Ligne 192: | Ligne 187: | ||
< | < | ||
- | root@debian8:~# cat / | + | root@debian11:~# cat / |
# | # | ||
# DO NOT EDIT THIS FILE | # DO NOT EDIT THIS FILE | ||
Ligne 257: | Ligne 252: | ||
set root=' | set root=' | ||
if [ x$feature_platform_search_hint = xy ]; then | if [ x$feature_platform_search_hint = xy ]; then | ||
- | search --no-floppy --fs-uuid --set=root --hint-bios=hd0, | + | search --no-floppy --fs-uuid --set=root --hint-bios=hd0, |
else | else | ||
- | search --no-floppy --fs-uuid --set=root | + | search --no-floppy --fs-uuid --set=root |
fi | fi | ||
font="/ | font="/ | ||
Ligne 274: | Ligne 269: | ||
terminal_output gfxterm | terminal_output gfxterm | ||
if [ " | if [ " | ||
- | set timeout=-1 | + | set timeout=30 |
else | else | ||
if [ x$feature_timeout_style = xy ] ; then | if [ x$feature_timeout_style = xy ] ; then | ||
Ligne 292: | Ligne 287: | ||
set root=' | set root=' | ||
if [ x$feature_platform_search_hint = xy ]; then | if [ x$feature_platform_search_hint = xy ]; then | ||
- | search --no-floppy --fs-uuid --set=root --hint-bios=hd0, | + | search --no-floppy --fs-uuid --set=root --hint-bios=hd0, |
else | else | ||
- | search --no-floppy --fs-uuid --set=root | + | search --no-floppy --fs-uuid --set=root |
fi | fi | ||
insmod png | insmod png | ||
- | if background_image /usr/share/images/ | + | if background_image / |
set color_normal=white/ | set color_normal=white/ | ||
set color_highlight=black/ | set color_highlight=black/ | ||
Ligne 308: | Ligne 303: | ||
### BEGIN / | ### BEGIN / | ||
function gfxmode { | function gfxmode { | ||
- | set gfxpayload=" | + | |
} | } | ||
set linux_gfx_mode= | set linux_gfx_mode= | ||
export linux_gfx_mode | export linux_gfx_mode | ||
- | menuentry ' | + | menuentry ' |
- | load_video | + | load_video |
- | insmod gzio | + | insmod gzio |
- | if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi | + | if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi |
- | insmod part_msdos | + | insmod part_msdos |
- | insmod ext2 | + | insmod ext2 |
- | set root=' | + | set root=' |
- | if [ x$feature_platform_search_hint = xy ]; then | + | if [ x$feature_platform_search_hint = xy ]; then |
- | | + | search --no-floppy --fs-uuid --set=root --hint-bios=hd0, |
- | else | + | else |
- | | + | search --no-floppy --fs-uuid --set=root |
- | fi | + | fi |
- | echo ' | + | echo ' |
- | linux / | + | linux |
- | echo ' | + | echo ' |
- | initrd / | + | initrd |
} | } | ||
- | submenu ' | + | submenu ' |
- | menuentry ' | + | menuentry ' |
- | load_video | + | load_video |
- | insmod gzio | + | insmod gzio |
- | if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi | + | if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi |
- | insmod part_msdos | + | insmod part_msdos |
- | insmod ext2 | + | insmod ext2 |
- | set root=' | + | set root=' |
- | if [ x$feature_platform_search_hint = xy ]; then | + | if [ x$feature_platform_search_hint = xy ]; then |
- | | + | search --no-floppy --fs-uuid --set=root --hint-bios=hd0, |
- | else | + | else |
- | | + | search --no-floppy --fs-uuid --set=root |
- | fi | + | fi |
- | echo ' | + | echo ' |
- | linux / | + | linux |
- | echo ' | + | echo ' |
- | initrd / | + | initrd |
- | } | + | } |
- | menuentry ' | + | menuentry ' |
- | load_video | + | load_video |
- | insmod gzio | + | insmod gzio |
- | if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi | + | if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi |
- | insmod part_msdos | + | insmod part_msdos |
- | insmod ext2 | + | insmod ext2 |
- | set root=' | + | set root=' |
- | if [ x$feature_platform_search_hint = xy ]; then | + | if [ x$feature_platform_search_hint = xy ]; then |
- | | + | search --no-floppy --fs-uuid --set=root --hint-bios=hd0, |
- | else | + | else |
- | | + | search --no-floppy --fs-uuid --set=root |
- | fi | + | fi |
- | echo ' | + | echo ' |
- | linux / | + | linux |
- | echo ' | + | echo ' |
- | initrd / | + | initrd |
- | } | + | } |
- | menuentry ' | + | |
- | load_video | + | |
- | insmod gzio | + | |
- | if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi | + | |
- | insmod part_msdos | + | |
- | insmod ext2 | + | |
- | set root=' | + | |
- | if [ x$feature_platform_search_hint = xy ]; then | + | |
- | search --no-floppy --fs-uuid --set=root --hint-bios=hd0, | + | |
- | else | + | |
- | search --no-floppy --fs-uuid --set=root 0fc7a234-259a-416b-b674-51eedfb1823b | + | |
- | fi | + | |
- | echo ' | + | |
- | linux / | + | |
- | echo ' | + | |
- | initrd / | + | |
- | } | + | |
- | menuentry ' | + | |
- | load_video | + | |
- | insmod gzio | + | |
- | if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi | + | |
- | insmod part_msdos | + | |
- | insmod ext2 | + | |
- | set root=' | + | |
- | if [ x$feature_platform_search_hint = xy ]; then | + | |
- | search --no-floppy --fs-uuid --set=root --hint-bios=hd0, | + | |
- | else | + | |
- | search --no-floppy --fs-uuid --set=root 0fc7a234-259a-416b-b674-51eedfb1823b | + | |
- | fi | + | |
- | echo ' | + | |
- | linux / | + | |
- | echo ' | + | |
- | initrd / | + | |
- | } | + | |
} | } | ||
Ligne 405: | Ligne 366: | ||
### END / | ### END / | ||
- | |||
- | ### BEGIN / | ||
- | menuentry " | ||
- | insmod part_msdos | ||
- | insmod ext2 | ||
- | set root=' | ||
- | if [ x$feature_platform_search_hint = xy ]; then | ||
- | search --no-floppy --fs-uuid --set=root --hint-bios=hd0, | ||
- | else | ||
- | search --no-floppy --fs-uuid --set=root 0fc7a234-259a-416b-b674-51eedfb1823b | ||
- | fi | ||
- | linux16 / | ||
- | } | ||
- | menuentry " | ||
- | insmod part_msdos | ||
- | insmod ext2 | ||
- | set root=' | ||
- | if [ x$feature_platform_search_hint = xy ]; then | ||
- | search --no-floppy --fs-uuid --set=root --hint-bios=hd0, | ||
- | else | ||
- | search --no-floppy --fs-uuid --set=root 0fc7a234-259a-416b-b674-51eedfb1823b | ||
- | fi | ||
- | linux16 / | ||
- | } | ||
- | menuentry " | ||
- | insmod part_msdos | ||
- | insmod ext2 | ||
- | set root=' | ||
- | if [ x$feature_platform_search_hint = xy ]; then | ||
- | search --no-floppy --fs-uuid --set=root --hint-bios=hd0, | ||
- | else | ||
- | search --no-floppy --fs-uuid --set=root 0fc7a234-259a-416b-b674-51eedfb1823b | ||
- | fi | ||
- | multiboot / | ||
- | } | ||
- | menuentry " | ||
- | insmod part_msdos | ||
- | insmod ext2 | ||
- | set root=' | ||
- | if [ x$feature_platform_search_hint = xy ]; then | ||
- | search --no-floppy --fs-uuid --set=root --hint-bios=hd0, | ||
- | else | ||
- | search --no-floppy --fs-uuid --set=root 0fc7a234-259a-416b-b674-51eedfb1823b | ||
- | fi | ||
- | multiboot / | ||
- | } | ||
- | ### END / | ||
### BEGIN / | ### BEGIN / | ||
Ligne 472: | Ligne 386: | ||
fi | fi | ||
### END / | ### END / | ||
- | |||
</ | </ | ||
Ligne 490: | Ligne 403: | ||
* grub-mkconfig -o / | * grub-mkconfig -o / | ||
- | Lors de l' | + | Lors de l' |
===Le fichier / | ===Le fichier / | ||
< | < | ||
- | root@debian8:~# cat / | + | root@debian11:~# cat / |
cat: / | cat: / | ||
- | root@debian8:~# which grub-mkdevicemap | + | root@debian11:~# grub-mkdevicemap |
- | /usr/sbin/grub-mkdevicemap | + | root@debian11:~# cat / |
- | root@debian8:~# grub-mkdevicemap | + | (hd0) |
- | root@debian8:~# cat / | + | (hd1) / |
- | (hd0) / | + | (hd2) / |
+ | (hd3) / | ||
+ | (hd4) / | ||
+ | (hd5) / | ||
</ | </ | ||
Ligne 509: | Ligne 425: | ||
< | < | ||
- | root@debian8:~# cat / | + | root@debian11:~# cat / |
# If you change this file, run ' | # If you change this file, run ' | ||
# / | # / | ||
Ligne 519: | Ligne 435: | ||
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` | GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` | ||
GRUB_CMDLINE_LINUX_DEFAULT=" | GRUB_CMDLINE_LINUX_DEFAULT=" | ||
- | GRUB_CMDLINE_LINUX=" | + | GRUB_CMDLINE_LINUX="" |
# Uncomment to enable BadRAM filtering, modify to suit your needs | # Uncomment to enable BadRAM filtering, modify to suit your needs | ||
Ligne 545: | Ligne 461: | ||
<WRAP center round important> | <WRAP center round important> | ||
- | **Important** : Notez que toute modification de ce fichier nécessite l' | + | **Important** : Notez que toute modification de ce fichier nécessite l' |
</ | </ | ||
- | Dans ce fichier les directives sont : | + | Dans ce fichier les directives |
^ Directive | ^ Directive | ||
Ligne 556: | Ligne 472: | ||
| GRUB_CMDLINE_LINUX_DEFAULT | Paramètres passés au noyau lors d'un démarrage normal (Hors donc le mode secours) | | | GRUB_CMDLINE_LINUX_DEFAULT | Paramètres passés au noyau lors d'un démarrage normal (Hors donc le mode secours) | | ||
| GRUB_CMDLINE_LINUX | Paramètres passés au noyau peu importe le type de démarrage | | | GRUB_CMDLINE_LINUX | Paramètres passés au noyau peu importe le type de démarrage | | ||
+ | | GRUB_BADRAM | Permet de spécifier de la mémoire défaillante | | ||
| GRUB_TERMINAL | Si non commentée, cette directive désactive le démarrage graphique | | | GRUB_TERMINAL | Si non commentée, cette directive désactive le démarrage graphique | | ||
| GRUB_GFXMODE | Indique la résolution utilisée lors d'un démarrage graphique | | | GRUB_GFXMODE | Indique la résolution utilisée lors d'un démarrage graphique | | ||
Ligne 561: | Ligne 478: | ||
| GRUB_DISABLE_LINUX_RECOVERY | Si **true**, cette directive empêche la génération des entrées en mode **recovery** | | | GRUB_DISABLE_LINUX_RECOVERY | Si **true**, cette directive empêche la génération des entrées en mode **recovery** | | ||
| GRUB_INIT_TUNE | Permet d' | | GRUB_INIT_TUNE | Permet d' | ||
- | | GRUB_BADRAM | Permet de spécifier de la mémoire défaillante | | ||
===Les fichiers du répertoire / | ===Les fichiers du répertoire / | ||
Ligne 568: | Ligne 484: | ||
< | < | ||
- | root@debian8:~# ls -l / | + | root@debian11:~# ls -l / |
- | total 76 | + | total 80 |
- | -rwxr-xr-x 1 root root | + | -rwxr-xr-x 1 root root 10046 Jul 11 2021 00_header |
- | -rwxr-xr-x 1 root root | + | -rwxr-xr-x 1 root root |
- | -rwxr-xr-x 1 root root 12261 Mar 23 2015 10_linux | + | -rwxr-xr-x 1 root root 13664 Jul 11 2021 10_linux |
- | -rwxr-xr-x 1 root root 11082 Mar 23 2015 20_linux_xen | + | -rwxr-xr-x 1 root root 13726 Jul 11 2021 20_linux_xen |
- | -rwxr-xr-x 1 root root | + | -rwxr-xr-x 1 root root 12059 Jul 11 2021 30_os-prober |
- | -rwxr-xr-x 1 root root 11692 Mar 23 2015 30_os-prober | + | -rwxr-xr-x 1 root root 1416 Jul 11 2021 30_uefi-firmware |
- | -rwxr-xr-x 1 root root 1416 Mar 23 2015 30_uefi-firmware | + | -rwxr-xr-x 1 root root |
- | -rwxr-xr-x 1 root root | + | -rwxr-xr-x 1 root root |
- | -rwxr-xr-x 1 root root | + | -rw-r--r-- 1 root root |
- | -rw-r--r-- 1 root root | + | |
</ | </ | ||
Ligne 588: | Ligne 503: | ||
* **Les fichiers / | * **Les fichiers / | ||
* Ces deux fichiers sont fournis en tant que modèles à personnaliser. | * Ces deux fichiers sont fournis en tant que modèles à personnaliser. | ||
- | |||
- | ===Configurer l' | ||
- | |||
- | Pour configurer l' | ||
- | |||
- | < | ||
- | root@debian8: | ||
- | root@debian8: | ||
- | </ | ||
- | |||
- | Créez deux mots de passe hashés au format **[[https:// | ||
- | |||
- | < | ||
- | root@debian8: | ||
- | Enter password: pass123 | ||
- | Reenter password: pass123 | ||
- | PBKDF2 hash of your password is grub.pbkdf2.sha512.10000.270AE83E768097679495D221C76D2052E6493B7787E374A7BF6EFFC93E375427866E34C75E668778FAF795B19E38FAA5C864A86F1372ECBC1E559E546AF11D71.64C6E790267D3B9B84CF4DFA062A64ECAB4C8831AA80D5FA210C6886C4B1ED96155D66B0A90F4C6FC32CE59D8FE67E0A465E829E39E3B1BAE180C31C547BBABE | ||
- | </ | ||
- | |||
- | Editez le fichier **/ | ||
- | |||
- | <file txt / | ||
- | #!/bin/sh -e | ||
- | cat <<EOF | ||
- | set superusers=" | ||
- | password_pbkdf2 root | ||
- | grub.pbkdf2.sha512.10000.270AE83E768097679495D221C76D2052E6493B7787E374A7BF6EFFC93E375427866E34C75E668778FAF795B19E38FAA5C864A86F1372ECBC1E559E546AF11D71.64C6E790267D3B9B84CF4DFA062A64ECAB4C8831AA80D5FA210C6886C4B1ED96155D66B0A90F4C6FC32CE59D8FE67E0A465E829E39E3B1BAE180C31C547BBABE | ||
- | EOF | ||
- | </ | ||
- | |||
- | Il est aussi possible d' | ||
- | |||
- | <file txt / | ||
- | #!/bin/sh -e | ||
- | cat <<EOF | ||
- | set superusers=" | ||
- | password root fenestros | ||
- | EOF | ||
- | </ | ||
- | |||
- | Lancez la commande **grub-mkconfig -o / | ||
- | |||
- | < | ||
- | root@debian8: | ||
- | Generating grub configuration file ... | ||
- | Found background image: / | ||
- | Found linux image: / | ||
- | Found initrd image: / | ||
- | Found linux image: / | ||
- | Found initrd image: / | ||
- | Found memtest86+ image: / | ||
- | Found memtest86+ multiboot image: / | ||
- | done | ||
- | </ | ||
- | |||
- | <WRAP center round todo> | ||
- | **A faire** : Redémarrez votre VM. Constatez que GRUB 2 demande un nom d' | ||
- | </ | ||
===Modifier la Configuration de GRUB 2 en Ligne de Commande=== | ===Modifier la Configuration de GRUB 2 en Ligne de Commande=== | ||
Ligne 703: | Ligne 560: | ||
Un Charger de Démarrage hybride, appelé **isodhpfx.bin**, | Un Charger de Démarrage hybride, appelé **isodhpfx.bin**, | ||
- | =====Initramfs | + | =====Initramfs===== |
Le fichier Initramfs //%%INITial Ram File System%%// est une image d'un système minimal initialisée au démarrage du système. | Le fichier Initramfs //%%INITial Ram File System%%// est une image d'un système minimal initialisée au démarrage du système. | ||
- | ====Examiner l' | + | ====LAB #1 - Travailler avec Initramfs==== |
+ | |||
+ | ===1.1 - Examiner l' | ||
Pour examiner une image initramfs, il convient d' | Pour examiner une image initramfs, il convient d' | ||
< | < | ||
- | root@debian8:~# cp / | + | root@debian11:~# cp / |
- | root@debian8:~# gunzip / | + | root@debian11:~# gunzip / |
</ | </ | ||
Ligne 719: | Ligne 578: | ||
< | < | ||
- | root@debian8:~# cd /tmp | + | root@debian11:~# cd /tmp |
- | root@debian8:/tmp# mkdir initrd | + | root@debian11:/tmp# mkdir initrd |
- | root@debian8:/tmp# cd initrd | + | root@debian11:/tmp# cd initrd |
- | root@debian8:/ | + | root@debian11:/ |
- | . | + | |
- | sbin | + | |
- | sbin/fsck | + | |
- | sbin/ | + | |
- | sbin/ | + | |
- | sbin/ | + | |
- | sbin/ | + | |
- | sbin/ | + | |
- | sbin/ | + | |
- | sbin/ | + | |
- | sbin/ | + | |
- | sbin/ | + | |
- | sbin/ | + | |
- | sbin/ | + | |
- | sbin/ | + | |
... | ... | ||
- | conf | + | var |
- | conf/arch.conf | + | var/cache |
- | conf/conf.d | + | var/ |
- | conf/conf.d/resume | + | var/ |
- | conf/initramfs.conf | + | var/cache/ |
- | 10250 blocks | + | var/cache/ |
+ | var/cache/ | ||
+ | var/ | ||
+ | 31991 blocks | ||
</ | </ | ||
Ligne 750: | Ligne 597: | ||
< | < | ||
- | root@debian8:/ | + | root@debian11:/ |
- | Reading package lists... Done | + | |
- | Building dependency tree | + | |
- | Reading state information... Done | + | |
- | The following NEW packages will be installed: | + | |
- | tree | + | |
- | 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. | + | |
- | Need to get 47.9 kB of archives. | + | |
- | After this operation, 137 kB of additional disk space will be used. | + | |
- | Get:1 http:// | + | |
- | Fetched 47.9 kB in 0s (263 kB/s) | + | |
- | Selecting previously unselected package tree. | + | |
- | (Reading database ... 167512 files and directories currently installed.) | + | |
- | Preparing to unpack .../ | + | |
- | Unpacking tree (1.7.0-3) ... | + | |
- | Processing triggers for man-db (2.7.0.2-5) ... | + | |
- | Setting up tree (1.7.0-3) ... | + | |
</ | </ | ||
Ligne 772: | Ligne 603: | ||
< | < | ||
- | root@debian8:/ | + | root@debian11:/ |
. | . | ||
- | ├── bin | + | ├── |
- | │ | + | ├── conf |
- | │ | + | │ |
- | │ | + | │ |
- | │ | + | │ │ |
- | │ | + | │ |
- | │ | + | ├── |
- | │ | + | │ └── crypttab |
- | │ | + | ├── |
- | │ | + | │ |
- | │ | + | │ │ |
- | │ | + | │ |
- | │ | + | │ |
- | │ | + | │ |
- | │ | + | │ |
- | │ | + | │ │ |
- | │ | + | │ |
- | │ | + | │ |
- | │ | + | │ |
- | │ | + | │ |
- | │ | + | │ |
- | │ | + | │ |
- | │ | + | │ │ |
- | │ | + | │ |
- | │ | + | │ |
- | │ | + | │ │ |
- | │ | + | │ |
- | │ | + | │ |
- | │ | + | │ |
- | │ | + | │ |
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
--More-- | --More-- | ||
+ | [q] | ||
</ | </ | ||
Ligne 810: | Ligne 669: | ||
< | < | ||
- | root@debian8:/ | + | root@debian11:/ |
- | total 44 | + | total 36 |
- | drwxr-xr-x | + | lrwxrwxrwx |
- | drwxr-xr-x | + | drwxr-xr-x |
- | drwxr-xr-x | + | drwxr-xr-x |
- | -rwxr-xr-x 1 root root 7057 Oct 29 16:17 init | + | drwxr-xr-x |
- | drwxr-xr-x 8 root root 4096 Oct 29 16:17 lib | + | -rwxr-xr-x |
- | drwxr-xr-x 2 root root 4096 Oct 29 16:17 run | + | lrwxrwxrwx |
- | drwxr-xr-x 2 root root 4096 Oct 29 16:17 sbin | + | lrwxrwxrwx |
- | drwxr-xr-x | + | lrwxrwxrwx |
- | drwxr-xr-x | + | lrwxrwxrwx |
- | drwxr-xr-x 3 root root 4096 Oct 29 16:17 var | + | drwxr-xr-x |
+ | lrwxrwxrwx | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x | ||
</ | </ | ||
- | |||
- | ====Le script init==== | ||
Le script **init** est lancé lors du chargement de l' | Le script **init** est lancé lors du chargement de l' | ||
< | < | ||
- | -rwxr-xr-x 1 root root 7057 Oct 29 16:17 init | + | root@debian11:/ |
+ | #!/bin/sh | ||
+ | |||
+ | # Default PATH differs between shells, and is not automatically exported | ||
+ | # by klibc dash. Make it consistent. | ||
+ | export PATH=/ | ||
+ | |||
+ | [ -d /dev ] || mkdir -m 0755 /dev | ||
+ | [ -d /root ] || mkdir -m 0700 /root | ||
+ | [ -d /sys ] || mkdir /sys | ||
+ | [ -d /proc ] || mkdir /proc | ||
+ | [ -d /tmp ] || mkdir /tmp | ||
+ | mkdir -p /var/lock | ||
+ | mount -t sysfs -o nodev, | ||
+ | mount -t proc -o nodev, | ||
+ | |||
+ | # shellcheck disable=SC2013 | ||
+ | for x in $(cat / | ||
+ | case $x in | ||
+ | initramfs.clear) | ||
+ | clear | ||
+ | ;; | ||
+ | quiet) | ||
+ | quiet=y | ||
+ | ;; | ||
+ | esac | ||
+ | done | ||
+ | |||
+ | if [ " | ||
+ | quiet=n | ||
+ | echo " | ||
+ | fi | ||
+ | export quiet | ||
+ | |||
+ | # Note that this only becomes /dev on the real filesystem if udev's scripts | ||
+ | # are used; which they will be, but it's worth pointing out | ||
+ | mount -t devtmpfs -o nosuid, | ||
+ | mkdir /dev/pts | ||
+ | mount -t devpts -o noexec, | ||
+ | |||
+ | # Export the dpkg architecture | ||
+ | export DPKG_ARCH= | ||
+ | . / | ||
+ | |||
+ | # Set modprobe env | ||
+ | export MODPROBE_OPTIONS=" | ||
+ | |||
+ | # Export relevant variables | ||
+ | export ROOT= | ||
+ | export ROOTDELAY= | ||
+ | export ROOTFLAGS= | ||
+ | export ROOTFSTYPE= | ||
+ | export IP= | ||
+ | export DEVICE= | ||
+ | export BOOT= | ||
+ | export BOOTIF= | ||
+ | export UBIMTD= | ||
+ | export break= | ||
+ | export | ||
+ | --More--(19%) | ||
</ | </ | ||
Ligne 836: | Ligne 756: | ||
</ | </ | ||
- | ====La commande mkinitramfs==== | + | ===1.2 - La commande mkinitramfs=== |
La commande **mkinitramfs** permet de créer facilement une image initramfs. Les options de la commande sont : | La commande **mkinitramfs** permet de créer facilement une image initramfs. Les options de la commande sont : | ||
Ligne 842: | Ligne 762: | ||
Le fichier de configuration de mkinitramfs est **/ | Le fichier de configuration de mkinitramfs est **/ | ||
- | <file> | + | <code> |
+ | root@debian11:/ | ||
+ | root@debian11:/ | ||
# List of modules that you want to include in your initramfs. | # List of modules that you want to include in your initramfs. | ||
# They will be loaded at boot time in the order below. | # They will be loaded at boot time in the order below. | ||
Ligne 862: | Ligne 784: | ||
scsi_mod | scsi_mod | ||
sd_mod | sd_mod | ||
- | </file> | + | </code> |
Exécutez maintenant la commande suivante afin de générer le fichier **usbinitramfs** : | Exécutez maintenant la commande suivante afin de générer le fichier **usbinitramfs** : | ||
< | < | ||
- | root@debian8:/ | + | root@debian11:/ |
</ | </ | ||
Ligne 873: | Ligne 795: | ||
< | < | ||
- | root@debian8:/ | + | root@debian11:/ |
- | -rw-r--r-- 1 root root 21454339 Oct 29 16:35 / | + | -rw-r--r-- 1 root root 47695493 Apr 30 11:12 / |
</ | </ | ||
Ligne 880: | Ligne 802: | ||
< | < | ||
- | root@debian8:/ | + | root@debian11:/ |
</ | </ | ||
Créez maintenant le fichier **/ | Créez maintenant le fichier **/ | ||
- | <file> | + | <code> |
+ | root@debian11:/ | ||
+ | root@debian11:/ | ||
#!/bin/sh -e | #!/bin/sh -e | ||
cat << EOF | cat << EOF | ||
- | menuentry ' | + | menuentry ' |
- | load_video | + | load_video |
- | insmod gzio | + | insmod gzio |
- | if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi | + | if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi |
- | insmod part_msdos | + | insmod part_msdos |
- | insmod ext2 | + | insmod ext2 |
- | set root=' | + | set root=' |
- | if [ x$feature_platform_search_hint = xy ]; then | + | if [ x$feature_platform_search_hint = xy ]; then |
- | | + | search --no-floppy --fs-uuid --set=root --hint-bios=hd0, |
- | else | + | else |
- | | + | search --no-floppy --fs-uuid --set=root |
- | fi | + | fi |
- | echo ' | + | echo ' |
- | linux / | + | linux |
- | echo ' | + | echo ' |
- | initrd / | + | initrd |
} | } | ||
EOF | EOF | ||
- | </file> | + | </code> |
Rendez ce fichier exécutable : | Rendez ce fichier exécutable : | ||
< | < | ||
- | root@debian8:/ | + | root@debian11:/ |
</ | </ | ||
- | |||
- | Avant de continuer, supprimer le fichier **/ | ||
- | |||
- | < | ||
- | #!/bin/sh | ||
- | exec tail -n +3 $0 | ||
- | # This file provides an easy way to add custom menu entries. | ||
- | # menu entries you want to add after this comment. | ||
- | # the 'exec tail' line above. | ||
- | </ | ||
Mettez à jour grub afin que celui-ci prend en compte le nouveau fichier : | Mettez à jour grub afin que celui-ci prend en compte le nouveau fichier : | ||
< | < | ||
- | root@debian8:/ | + | root@debian11:/ |
Generating grub configuration file ... | Generating grub configuration file ... | ||
Found background image: / | Found background image: / | ||
- | Found linux image: / | + | Found linux image: / |
- | Found initrd image: / | + | Found initrd image: / |
- | Found linux image: / | + | |
- | Found initrd image: / | + | |
- | Found memtest86+ image: / | + | |
- | Found memtest86+ multiboot image: / | + | |
done | done | ||
</ | </ | ||
- | |||
- | <WRAP center round important> | ||
- | **Important** : Notez l' | ||
- | </ | ||
Controlez le fichier / | Controlez le fichier / | ||
Ligne 947: | Ligne 853: | ||
< | < | ||
... | ... | ||
+ | ### END / | ||
+ | |||
### BEGIN / | ### BEGIN / | ||
- | menuentry ' | + | menuentry ' |
- | load_video | + | load_video |
- | insmod gzio | + | insmod gzio |
- | if [ x = xxen ]; then insmod xzio; insmod lzopio; fi | + | if [ x = xxen ]; then insmod xzio; insmod lzopio; fi |
- | insmod part_msdos | + | insmod part_msdos |
- | insmod ext2 | + | insmod ext2 |
- | set root=' | + | set root=' |
- | if [ x = xy ]; then | + | if [ x = xy ]; then |
- | | + | search --no-floppy --fs-uuid --set=root --hint-bios=hd0, |
- | else | + | else |
- | | + | search --no-floppy --fs-uuid --set=root |
- | fi | + | fi |
- | echo ' | + | echo ' |
- | linux / | + | linux |
- | echo ' | + | echo ' |
- | initrd / | + | initrd |
} | } | ||
### END / | ### END / | ||
Ligne 970: | Ligne 878: | ||
... | ... | ||
</ | </ | ||
- | |||
- | <WRAP center round todo> | ||
- | **A faire** : **Re-démarrez votre machine pour tester votre configuration.** | ||
- | </ | ||
=====Processus de Démarrage du Noyau Linux===== | =====Processus de Démarrage du Noyau Linux===== | ||
Ligne 989: | Ligne 893: | ||
La fonction **init_post()** essaie ensuite d' | La fonction **init_post()** essaie ensuite d' | ||
- | * /sbin/init | + | * / |
* /etc/init | * /etc/init | ||
* /bin/init | * /bin/init | ||
- | * / | + | * / |
+ | |||
+ | < | ||
+ | root@debian11:/ | ||
+ | lrwxrwxrwx 1 root root 20 Mar 20 20:55 /sbin/init -> / | ||
+ | root@debian11:/ | ||
+ | ls: cannot access '/ | ||
+ | root@debian11:/ | ||
+ | ls: cannot access '/ | ||
+ | root@debian11:/ | ||
+ | lrwxrwxrwx 1 root root 4 Apr 25 06:30 /bin/sh -> dash | ||
+ | root@debian11:/ | ||
+ | -rwxr-xr-x 1 root root 125560 Dec 10 2020 /bin/dash | ||
+ | root@debian11:/ | ||
+ | -rwxr-xr-x 1 root root 125560 Dec 10 2020 / | ||
+ | </ | ||
Dans le cas d'un échec à ce stade le message **Kernel Panic** sera affiché. | Dans le cas d'un échec à ce stade le message **Kernel Panic** sera affiché. | ||
- | =====Processus Init===== | + | =====Systemd===== |
- | Le premier processus lancé par le noyau est **Init**. L' | + | Les systèmes de démarrage antérieurs à Systemd, |
- | | + | **Systemd** essaie, par contre, de démarrer autant de services en parallèle que possible. Ceci est rendu possible car la majorité d'architectures matérielles modernes sont multi-cœurs. Si un service dépend d'un autre qui n'est pas encore démarré ce premier est mis en attente dans une mémoire tampon. Qui plus est, les services qui ne sont pas nécessaires au démarrage |
- | | + | |
- | * l' | + | |
- | * la mise à l'heure du système, | + | |
- | * la définition des consoles textes, | + | |
- | * la définition du nom de la machine, | + | |
- | * la détection des périphériques USB, | + | |
- | * la mise en place du support RAID et LVM, | + | |
- | * l' | + | |
- | * le montages des systèmes de fichiers, | + | |
- | * le re-montage du système de fichiers racine | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | * la définition des variables d' | + | |
- | =====Démarrer Debian 6 avec SysVinit===== | + | Au lieu de parler de scripts de démarrage et de niveaux d' |
- | ====Niveaux | + | * **.automount** - active la fonctionalité |
+ | * **.device** - expose une périphérique dans systemd. | ||
+ | * **.mount** - contrôle quand et comment les systèmes de fichiers sont montés. | ||
+ | * **.path** - active un service quand il y a un accès à un fichier ou répertoire | ||
+ | * **.service** - démarre, arrête, redémarre ou recharge un service. | ||
+ | * **.scope** - gère des services. | ||
+ | * **.slice** - regroupe des Unités dans une arborescence afin de limiter des ressources en utilisant des CGroups. | ||
+ | * **.snapshot** - un état sauvegardé du gestionnaire Systemd. | ||
+ | * **.socket** - permet aux Unités d' | ||
+ | * **.swap** - encapsule une périphérique ou un fichier swap. | ||
+ | * **.timer** - déclenche l' | ||
+ | * **.target** - regroupe des Unités multiples afin qu' | ||
- | Il existe 8 niveaux d' | + | Une Cible est en quelque sorte une **grande étape** dans le démarrage du système |
- | ^ RUNLEVEL ^ Description ^ | + | * **halt.target** - arrête le système. |
- | | 0 | Arrêt de la machine | | + | * **poweroff.target** - arrête le système et coupe le courant. |
- | | 1 | Mode mono-utilisateur pour la maintenance | | + | * **shutdown.target** |
- | | 6 | Redémarrage | + | * **rescue.target** - démarre le système en mode single-user (seul root peut s'y connecter). Tous les systèmes |
- | | S ou s | Mode mono-utilisateur avec seul la partition racine montée | | + | * **emergency.target** - démarre le système en mode single-user (seul root peut s'y connecter). Uniquement le système de fichiers racine est monté en mode lecture seule. Le réseau n'est pas démarré. |
+ | * **multi-user.target** - démarre le système en mode multi-utilisateur avec tous les systèmes de fichiers montés et le service network démarré. | ||
+ | * **graphical.target** - démarre le système en multi-user.target puis démarre l' | ||
+ | * **hibernate.target** - sauvegarde l' | ||
+ | * **reboot.target** - redémarre le système. | ||
- | Les autres quatre RUNLEVELS sont définis par chaque distribution. Par exemple, sous Debian, ils sont : | + | **Systemd** utilise des Cibles d'une manière similaire à ce que **SysVinit** utilise des niveaux d' |
- | ^ RUNLEVEL ^ Description ^ | + | < |
- | | 2 | Mode multi-utilisateur | | + | root@debian11:/ |
- | | 3 | Mode multi-utilisateur | + | lrwxrwxrwx 1 root root 15 Mar 20 20:55 / |
- | | 4 | Mode multi-utilisateur | + | lrwxrwxrwx 1 root root 13 Mar 20 20:55 / |
- | | 5 | Mode multi-utilisateur | + | lrwxrwxrwx 1 root root 17 Mar 20 20:55 / |
+ | lrwxrwxrwx 1 root root 17 Mar 20 20:55 / | ||
+ | lrwxrwxrwx 1 root root 17 Mar 20 20:55 / | ||
+ | lrwxrwxrwx 1 root root 16 Mar 20 20:55 / | ||
+ | lrwxrwxrwx 1 root root 13 Mar 20 20:55 / | ||
- | Il existe aussi 3 pseudo-niveaux d' | + | / |
+ | total 0 | ||
- | Pour connaître le niveau | + | / |
+ | total 0 | ||
+ | |||
+ | / | ||
+ | total 0 | ||
+ | |||
+ | / | ||
+ | total 0 | ||
+ | |||
+ | / | ||
+ | total 0 | ||
+ | </ | ||
+ | |||
+ | ====LAB #2 - La Commande systemctl==== | ||
+ | |||
+ | Pour visualiser la liste des Unités, il convient | ||
< | < | ||
- | root@debian6:~# runlevel | + | root@debian11:/ |
- | N 2 | + | root@debian11:~# systemctl list-units |
+ | | ||
+ | proc-sys-fs-binfmt_misc.automount | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-platform-serial8250-tty-ttyS0.device | ||
+ | sys-devices-platform-serial8250-tty-ttyS1.device | ||
+ | sys-devices-platform-serial8250-tty-ttyS2.device | ||
+ | sys-devices-platform-serial8250-tty-ttyS3.device | ||
+ | sys-devices-virtual-block-dm\x2d0.device | ||
+ | sys-devices-virtual-block-dm\x2d1.device | ||
+ | sys-devices-virtual-block-dm\x2d2.device | ||
+ | sys-devices-virtual-misc-rfkill.device | ||
+ | sys-module-configfs.device | ||
+ | sys-module-fuse.device | ||
+ | sys-subsystem-net-devices-ens18.device | ||
+ | -.mount | ||
+ | dev-hugepages.mount | ||
+ | dev-mqueue.mount | ||
+ | mnt-sdc11.mount | ||
+ | mnt-sdc12.mount | ||
+ | run-user-1000.mount | ||
+ | run-user-113.mount | ||
+ | sys-fs-fuse-connections.mount | ||
+ | sys-kernel-config.mount | ||
+ | sys-kernel-debug.mount | ||
+ | sys-kernel-tracing.mount | ||
+ | cups.path | ||
+ | systemd-ask-password-plymouth.path | ||
+ | systemd-ask-password-wall.path | ||
+ | init.scope | ||
+ | session-180.scope | ||
+ | session-c1.scope | ||
+ | apparmor.service | ||
+ | auditd.service | ||
+ | avahi-daemon.service | ||
+ | blk-availability.service | ||
+ | console-setup.service | ||
+ | cron.service | ||
+ | cups-browsed.service | ||
+ | cups.service | ||
+ | lines 1-58 | ||
+ | [q] | ||
</ | </ | ||
- | La lettre N indique que le système n'a pas changé de niveau d' | + | Pour consulter la liste des Unités inactifs, utilisez la commande suivante : |
- | Pour modifier le niveau d' | + | < |
+ | root@debian11:~# systemctl list-units --all | grep inactive | more | ||
+ | ● home.mount | ||
+ | proc-sys-fs-binfmt_misc.mount | ||
+ | ● tmp.mount | ||
+ | systemd-ask-password-console.path | ||
+ | anacron.service | ||
+ | apt-daily-upgrade.service | ||
+ | apt-daily.service | ||
+ | ● connman.service | ||
+ | ● console-screen.service | ||
+ | dm-event.service | ||
+ | e2scrub_all.service | ||
+ | e2scrub_reap.service | ||
+ | emergency.service | ||
+ | ● fcoe.service | ||
+ | fstrim.service | ||
+ | getty-static.service | ||
+ | ● iscsi-shutdown.service | ||
+ | ● iscsi.service | ||
+ | ● iscsid.service | ||
+ | ● kbd.service | ||
+ | logrotate.service | ||
+ | ● lvm2-activation.service | ||
+ | lvm2-lvmpolld.service | ||
+ | man-db.service | ||
+ | mlocate.service | ||
+ | modprobe@configfs.service | ||
+ | modprobe@drm.service | ||
+ | modprobe@fuse.service | ||
+ | ● nslcd.service | ||
+ | plymouth-quit.service | ||
+ | ● rbdmap.service | ||
+ | rc-local.service | ||
+ | rescue.service | ||
+ | rsync.service | ||
+ | ● sssd.service | ||
+ | systemd-ask-password-console.service | ||
+ | systemd-ask-password-plymouth.service | ||
+ | systemd-ask-password-wall.service | ||
+ | systemd-binfmt.service | ||
+ | systemd-boot-system-token.service | ||
+ | systemd-cryptsetup@sdc11.service | ||
+ | systemd-fsck-root.service | ||
+ | systemd-fsck@dev-mapper-sdc11.service | ||
+ | systemd-fsckd.service | ||
+ | systemd-hwdb-update.service | ||
+ | systemd-initctl.service | ||
+ | systemd-machine-id-commit.service | ||
+ | systemd-networkd.service | ||
+ | systemd-pstore.service | ||
+ | systemd-quotacheck.service | ||
+ | systemd-rfkill.service | ||
+ | systemd-tmpfiles-clean.service | ||
+ | ● systemd-update-done.service | ||
+ | systemd-update-utmp-runlevel.service | ||
+ | ● systemd-vconsole-setup.service | ||
+ | ● ypbind.service | ||
+ | system-systemd\x2dcryptsetup.slice | ||
+ | system-systemd\x2dfsck.slice | ||
+ | --More-- | ||
+ | [q] | ||
+ | </ | ||
- | ^ Option ^ Description ^ | + | Les points noirs au début |
- | | Q ou q | Demande à Init de relire le fichier / | + | |
- | | -t | Permet de modifier le temps accordé par Init aux processus entre l'envoi du signal SIGTERM et l'envoi du signal SIGKILL | | + | |
- | ====Inittab==== | + | < |
+ | root@debian11: | ||
+ | Unit connman.service could not be found. | ||
+ | </ | ||
- | Le fichier **/ | + | Pour consulter la liste des Unités ainsi que leurs statuts, utilisez la commande suivante |
< | < | ||
- | root@debian6:~# cat / | + | root@debian11:~# systemctl list-unit-files | more |
- | # / | + | UNIT FILE |
- | # $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $ | + | proc-sys-fs-binfmt_misc.automount |
+ | -.mount | ||
+ | dev-hugepages.mount | ||
+ | dev-mqueue.mount | ||
+ | media-cdrom0.mount | ||
+ | mnt-sdc11.mount | ||
+ | proc-sys-fs-binfmt_misc.mount | ||
+ | sys-fs-fuse-connections.mount | ||
+ | sys-kernel-config.mount | ||
+ | sys-kernel-debug.mount | ||
+ | sys-kernel-tracing.mount | ||
+ | cups.path | ||
+ | systemd-ask-password-console.path | ||
+ | systemd-ask-password-plymouth.path | ||
+ | systemd-ask-password-wall.path | ||
+ | session-180.scope | ||
+ | session-c1.scope | ||
+ | alsa-restore.service | ||
+ | alsa-state.service | ||
+ | alsa-utils.service | ||
+ | anacron.service | ||
+ | apparmor.service | ||
+ | apt-daily-upgrade.service | ||
+ | apt-daily.service | ||
+ | auditd.service | ||
+ | autovt@.service | ||
+ | avahi-daemon.service | ||
+ | blk-availability.service | ||
+ | colord.service | ||
+ | configure-printer@.service | ||
+ | console-getty.service | ||
+ | console-setup.service | ||
+ | container-getty@.service | ||
+ | cron.service | ||
+ | cryptdisks-early.service | ||
+ | cryptdisks.service | ||
+ | cups-browsed.service | ||
+ | cups.service | ||
+ | dbus-fi.w1.wpa_supplicant1.service | ||
+ | dbus-org.freedesktop.Avahi.service | ||
+ | dbus-org.freedesktop.hostname1.service | ||
+ | dbus-org.freedesktop.locale1.service | ||
+ | dbus-org.freedesktop.login1.service | ||
+ | dbus-org.freedesktop.ModemManager1.service | ||
+ | dbus-org.freedesktop.nm-dispatcher.service | ||
+ | dbus-org.freedesktop.timedate1.service | ||
+ | dbus-org.freedesktop.timesync1.service | ||
+ | dbus.service | ||
+ | debug-shell.service | ||
+ | display-manager.service | ||
+ | dm-event.service | ||
+ | e2scrub@.service | ||
+ | e2scrub_all.service | ||
+ | e2scrub_fail@.service | ||
+ | e2scrub_reap.service | ||
+ | emergency.service | ||
+ | fstrim.service | ||
+ | --More-- | ||
+ | [q] | ||
+ | </code> | ||
- | # The default runlevel. | + | Pour visualiser les Unités d'un type spécifique, |
- | id: | + | |
- | # Boot-time system configuration/ | + | < |
- | # This is run first except when booting in emergency (-b) mode. | + | root@debian11: |
- | si:: | + | UNIT FILE |
+ | -.mount | ||
+ | dev-hugepages.mount | ||
+ | dev-mqueue.mount static | ||
+ | media-cdrom0.mount | ||
+ | mnt-sdc11.mount | ||
+ | proc-sys-fs-binfmt_misc.mount disabled | ||
+ | sys-fs-fuse-connections.mount static | ||
+ | sys-kernel-config.mount | ||
+ | sys-kernel-debug.mount | ||
+ | sys-kernel-tracing.mount | ||
- | # What to do in single-user mode. | + | 10 unit files listed. |
- | ~~:S:wait:/sbin/ | + | </code> |
- | # /etc/init.d executes the S and K scripts upon change | + | Dans la colonne STATE on voit les mots **static** et **generated**. |
- | # of runlevel. | + | |
- | # | + | |
- | # Runlevel 0 is halt. | + | |
- | # Runlevel 1 is single-user. | + | |
- | # Runlevels 2-5 are multi-user. | + | |
- | # Runlevel 6 is reboot. | + | |
- | l0: | + | * STATE = static |
- | l1: | + | * Ceci implique que l' |
- | l2: | + | |
- | l3: | + | |
- | l4: | + | |
- | l5: | + | |
- | l6: | + | |
- | # Normally not reached, but fallthrough in case of emergency. | + | |
- | z6: | + | |
- | # What to do when CTRL-ALT-DEL is pressed. | + | * STATE = generated |
- | ca: | + | * Ceci implique que le fichier a été généré automatiquement en utilisant les informations dans le fichier **/etc/fstab** lors du démarrage du système. Dans le cas d'un point de montage, l' |
- | # Action on special keypress (ALT-UpArrow). | + | < |
- | # | + | root@debian11: |
+ | -rwxr-xr-x 1 root root 43440 Mar 20 20:55 /lib/systemd/ | ||
+ | </code> | ||
- | # What to do when the power fails/ | + | Il existe aussi d' |
- | pf:: | + | |
- | pn:: | + | |
- | po:: | + | |
- | # /sbin/getty invocations for the runlevels. | + | < |
- | # | + | root@debian11: |
- | # The " | + | total 420 |
- | # characters of the device (after " | + | -rwxr-xr-x 1 root root 146872 Feb 22 2021 lvm2-activation-generator |
- | # | + | -rwxr-xr-x 1 root root 14488 Mar 20 20:55 systemd-bless-boot-generator |
- | # Format: | + | -rwxr-xr-x 1 root root 35176 Mar 20 20:55 systemd-cryptsetup-generator |
- | # <id>:< | + | -rwxr-xr-x 1 root root 14632 Mar 20 20:55 systemd-debug-generator |
- | # | + | -rwxr-xr-x 1 root root 43440 Mar 20 20:55 systemd-fstab-generator |
- | # Note that on most Debian systems tty7 is used by the X Window System, | + | -rwxr-xr-x 1 root root 14480 Mar 20 20:55 systemd-getty-generator |
- | # so if you want to add more getty's go ahead but skip tty7 if you run X. | + | -rwxr-xr-x 1 root root 34968 Mar 20 20:55 systemd-gpt-auto-generator |
- | # | + | -rwxr-xr-x |
- | 1:2345:respawn:/ | + | -rwxr-xr-x 1 root root 14480 Mar 20 20:55 systemd-rc-local-generator |
- | 2:23: | + | -rwxr-xr-x 1 root root 14616 Mar 20 20:55 systemd-run-generator |
- | 3:23: | + | -rwxr-xr-x 1 root root 14480 Mar 20 20:55 systemd-system-update-generator |
- | 4:23: | + | -rwxr-xr-x 1 root root 30936 Mar 20 20:55 systemd-sysv-generator |
- | 5:23: | + | -rwxr-xr-x 1 root root 14624 Mar 20 20:55 systemd-veritysetup-generator |
- | 6: | + | </code> |
- | # Example how to put a getty on a serial line (for a terminal) | + | Les options de la commande **systemctl** sont : |
- | # | + | |
- | #T0:23: | + | |
- | # | + | |
- | # Example how to put a getty on a modem line. | + | < |
- | # | + | root@debian11: |
- | # | + | systemctl [OPTIONS...] COMMAND ... |
+ | |||
+ | Query or send control commands to the system manager. | ||
+ | |||
+ | Unit Commands: | ||
+ | list-units [PATTERN...] | ||
+ | list-sockets [PATTERN...] | ||
+ | ordered by address | ||
+ | list-timers [PATTERN...] | ||
+ | ordered by next elapse | ||
+ | is-active PATTERN... | ||
+ | is-failed PATTERN... | ||
+ | status [PATTERN...|PID...] | ||
+ | show [PATTERN...|JOB...] | ||
+ | units/jobs or the manager | ||
+ | cat PATTERN... | ||
+ | help PATTERN...|PID... | ||
+ | list-dependencies [UNIT...] | ||
+ | or wanted by the units or by which those | ||
+ | units are required or wanted | ||
+ | start UNIT... | ||
+ | stop UNIT... | ||
+ | reload UNIT... | ||
+ | restart UNIT... | ||
+ | try-restart UNIT... | ||
+ | reload-or-restart UNIT... | ||
+ | otherwise start or restart | ||
+ | try-reload-or-restart UNIT... | ||
+ | if supported, otherwise restart | ||
+ | isolate UNIT Start one unit and stop all others | ||
+ | kill UNIT... | ||
+ | clean UNIT... | ||
+ | configuration of unit | ||
+ | freeze PATTERN... | ||
+ | thaw PATTERN... | ||
+ | set-property UNIT PROPERTY=VALUE... Sets one or more properties of a unit | ||
+ | | ||
+ | | ||
+ | reset-failed [PATTERN...] | ||
+ | units | ||
+ | Unit File Commands: | ||
+ | list-unit-files [PATTERN...] | ||
+ | enable [UNIT...|PATH...] | ||
+ | disable UNIT... | ||
+ | reenable UNIT... | ||
+ | preset UNIT... | ||
+ | based on preset configuration | ||
+ | preset-all | ||
+ | preset configuration | ||
+ | is-enabled UNIT... | ||
+ | mask UNIT... | ||
+ | unmask UNIT... | ||
+ | link PATH... | ||
+ | the search path | ||
+ | revert UNIT... | ||
+ | version | ||
+ | add-wants TARGET UNIT... | ||
+ | on specified one or more units | ||
+ | lines 1-58 | ||
+ | [q] | ||
</ | </ | ||
- | Dans l' | + | ====LAB #3 - Fichiers |
- | ^ Champ ^ Nom ^ Description ^ | + | ===3.1 - Fichiers |
- | | 1 | Identifiant | Identifiant unique | + | |
- | | 2 | RUNLEVELS | Liste des niveaux d' | + | |
- | | 3 | Action | Méthode utilisé pour lancer la commande se trouvant dans le champ 4 | | + | |
- | | 4 | Commande | Commande à lancer | | + | |
- | Le champ **action** prend une des directives suivantes | + | Les fichiers de configuration des Cibles et fichiers de configuration des Unités installés par des paquets se trouvent dans le répertoire |
- | ^ Directive ^ Description ^ | + | < |
- | | respawn | Le processus est relancé en cas d' | + | root@debian11: |
- | | mingetty | Assure la gestion du terminal texte | | + | / |
- | | once | Le processus n'est exécuté qu'une fois | | + | </ |
- | | wait | Le processus n'est exécuté qu'une fois. Init attend la fin du processus avant de passer à la ligne suivante | | + | |
- | | boot | Le processus est exécuté au démarrage de la machine. Le champ RUNLEVELS est sans importance | | + | |
- | | bootwait | Le processus est exécuté au démarrage de la machine. Le champ RUNLEVELS est sans importance. Init attend la fin du processus avant de passer à la ligne suivante | | + | |
- | | off | Revient à commenter la ligne | | + | |
- | | ondemand | La même chose que respawn mais la commande est exécuté dans un des 3 pseudo-niveaux d' | + | |
- | | initdefault | Définit le niveau d' | + | |
- | | sysinit | La commande est exécutée au démarrage da la machine avant les lignes boot et bootwait | | + | |
- | | powerfail | La commande est exécutée quand init reçoit un signal SIGPWR d'un onduleur | | + | |
- | | powerwait | La commande est exécutée quand init reçoit un signal SIGPWR d'un onduleur. Init attend la fin du processus avant de passer à la ligne suivante | | + | |
- | | powerokwait | La commande est exécutée si Init reçoit un signal de rétablissement du courant | | + | |
- | | powerfailnow | La commande est exécutée quand Init reçoit un signal comme quoi la batterie de l' | + | |
- | | ctrlaltdel | La commande est exécutée quand Init reçoit un signal SIGINT. Ce signal est envoyé par la combinaison de touches [CTRL] [ALT] [SUPPR] | | + | |
- | | kbrequest | La commande est exécutée suivant des séquences de touches saisies au clavier | | + | |
- | L' | + | < |
+ | root@debian11: | ||
+ | total 1076 | ||
+ | -rw-r--r-- 1 root root 576 Dec 7 2020 alsa-restore.service | ||
+ | -rw-r--r-- 1 root root 528 Dec 7 2020 alsa-state.service | ||
+ | lrwxrwxrwx 1 root root 9 Dec 7 2020 alsa-utils.service -> /dev/null | ||
+ | -rw-r--r-- 1 root root 776 Feb | ||
+ | -rw-r--r-- 1 root root 154 Feb 6 2021 anacron.timer | ||
+ | -rw-r--r-- 1 root root 1162 Apr 3 2021 apparmor.service | ||
+ | -rw-r--r-- 1 root root 326 Jun 10 2021 apt-daily.service | ||
+ | -rw-r--r-- 1 root root 156 Jun 10 2021 apt-daily.timer | ||
+ | -rw-r--r-- 1 root root 389 Jun 10 2021 apt-daily-upgrade.service | ||
+ | -rw-r--r-- 1 root root 184 Jun 10 2021 apt-daily-upgrade.timer | ||
+ | -rw-r--r-- 1 root root 1491 Jan 6 2021 auditd.service | ||
+ | lrwxrwxrwx 1 root root 14 Mar 20 20:55 autovt@.service -> getty@.service | ||
+ | -rw-r--r-- 1 root root 1044 Feb 6 2021 avahi-daemon.service | ||
+ | -rw-r--r-- 1 root root 870 Feb 6 2021 avahi-daemon.socket | ||
+ | -rw-r--r-- 1 root root 927 Feb 2 2021 basic.target | ||
+ | -rw-r--r-- 1 root root 380 Feb 22 2021 blk-availability.service | ||
+ | -rw-r--r-- 1 root root 449 Feb 2 2021 blockdev@.target | ||
+ | -rw-r--r-- 1 root root 427 Feb 2 2021 bluetooth.target | ||
+ | -rw-r--r-- 1 root root 463 Feb 2 2021 boot-complete.target | ||
+ | -rw-r--r-- 1 root root 295 Nov 12 2020 colord.service | ||
+ | -rw-r--r-- 1 root root 150 Jan 13 2021 configure-printer@.service | ||
+ | -rw-r--r-- 1 root root 1073 Mar 20 20:55 console-getty.service | ||
+ | -rw-r--r-- 1 root root 312 Oct 29 2018 console-setup.service | ||
+ | -rw-r--r-- 1 root root 1254 Mar 20 20:55 container-getty@.service | ||
+ | -rw-r--r-- 1 root root 316 Feb 22 2021 cron.service | ||
+ | lrwxrwxrwx 1 root root 9 Mar 20 20:55 cryptdisks-early.service -> /dev/null | ||
+ | lrwxrwxrwx 1 root root 9 Mar 20 20:55 cryptdisks.service -> /dev/null | ||
+ | -rw-r--r-- 1 root root 473 Feb 2 2021 cryptsetup-pre.target | ||
+ | -rw-r--r-- 1 root root 420 Feb 2 2021 cryptsetup.target | ||
+ | lrwxrwxrwx 1 root root 13 Mar 20 20:55 ctrl-alt-del.target -> reboot.target | ||
+ | -rw-r--r-- 1 root root 234 Jan 7 2021 cups-browsed.service | ||
+ | -rw-r--r-- 1 root root 142 May 27 2021 cups.path | ||
+ | -rw-r--r-- 1 root root 278 May 27 2021 cups.service | ||
+ | -rw-r--r-- 1 root root 132 May 27 2021 cups.socket | ||
+ | lrwxrwxrwx 1 root root 25 Mar 20 20:55 dbus-org.freedesktop.hostname1.service -> systemd-hostnamed.service | ||
+ | lrwxrwxrwx 1 root root 23 Mar 20 20:55 dbus-org.freedesktop.locale1.service -> systemd-localed.service | ||
+ | lrwxrwxrwx 1 root root 22 Mar 20 20:55 dbus-org.freedesktop.login1.service -> systemd-logind.service | ||
+ | lrwxrwxrwx 1 root root 25 Mar 20 20:55 dbus-org.freedesktop.timedate1.service -> systemd-timedated.service | ||
+ | -rw-r--r-- 1 root root 380 Feb 21 2021 dbus.service | ||
+ | -rw-r--r-- 1 root root 102 Feb 21 2021 dbus.socket | ||
+ | -rw-r--r-- 1 root root 1065 Mar 20 20:55 debug-shell.service | ||
+ | lrwxrwxrwx 1 root root 16 Mar 20 20:55 default.target -> graphical.target | ||
+ | -rw-r--r-- 1 root root 758 Feb 2 2021 dev-hugepages.mount | ||
+ | -rw-r--r-- 1 root root 701 Feb 2 2021 dev-mqueue.mount | ||
+ | -rw-r--r-- 1 root root 341 Feb 22 2021 dm-event.service | ||
+ | -rw-r--r-- 1 root root 248 Feb 22 2021 dm-event.socket | ||
+ | -rw-r--r-- 1 root root 297 Jun 7 2021 e2scrub_all.service | ||
+ | -rw-r--r-- 1 root root 251 Jun 7 2021 e2scrub_all.timer | ||
+ | -rw-r--r-- 1 root root 245 Jun 7 2021 e2scrub_fail@.service | ||
+ | -rw-r--r-- 1 root root 550 Jun 7 2021 e2scrub_reap.service | ||
+ | -rw-r--r-- 1 root root 438 Jun 7 2021 e2scrub@.service | ||
+ | -rw-r--r-- 1 root root 805 Mar 20 20:55 emergency.service | ||
+ | -rw-r--r-- 1 root root 479 Feb 2 2021 emergency.target | ||
+ | -rw-r--r-- 1 root root 549 Feb 2 2021 exit.target | ||
+ | -rw-r--r-- 1 root root 488 Feb 2 2021 final.target | ||
+ | -rw-r--r-- 1 root root 461 Feb 2 2021 first-boot-complete.target | ||
+ | -rw-r--r-- 1 root root 477 Jan 20 21:10 fstrim.service | ||
+ | --More-- | ||
+ | [q] | ||
+ | </ | ||
- | ^ Ligne ^ Description ^ | + | ===3.2 - Surchargement des Fichiers |
- | | id: | + | |
- | | si:: | + | |
- | | ~~: | + | |
- | | l0: | + | |
- | | l1: | + | |
- | | l2:2: | + | |
- | | l3: | + | |
- | | l4: | + | |
- | | l5: | + | |
- | | l6: | + | |
- | | z6: | + | |
- | | ca: | + | |
- | | pf:: | + | |
- | | pn:: | + | |
- | | po:: | + | |
- | | 1: | + | |
- | | 2: | + | |
- | | 3: | + | |
- | | 4: | + | |
- | | 5: | + | |
- | | 6: | + | |
- | ====Scripts | + | Certains fichiers |
- | ===Le script rc.S sous Debian 6=== | + | < |
+ | root@debian11: | ||
+ | total 0 | ||
+ | </ | ||
- | D' | + | Les fichiers de configuration des Unités crées |
< | < | ||
- | root@debian6:/etc/init.d# cat /etc/init.d/rcS | + | root@debian11:~# pkg-config systemd --variable=systemduserunitdir |
- | #! /bin/sh | + | /usr/lib/systemd/user |
- | # | + | </code> |
- | # rcS | + | |
- | # | + | |
- | # Call all S??* scripts in /etc/rcS.d/ in numerical/ | + | |
- | # | + | |
- | exec /etc/init.d/rc S | + | <WRAP center round important 60%> |
+ | **Important** : De cette façon les fichiers dans **/usr/lib/ | ||
+ | </ | ||
+ | |||
+ | Les fichiers de configuration par défaut peuvent être surchargés par des fichiers dans d' | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | / | ||
</ | </ | ||
- | ====Répertoire init.d==== | + | ===3.3 - Les Fichiers |
- | Le répertoire | + | Prenons maintenant le cas du service **sshd** qui est configuré par le fichier |
< | < | ||
- | root@debian6:/etc# cd init.d | + | root@debian11:~# cat /lib/systemd/ |
- | root@debian6: | + | [Unit] |
- | acpid | + | Description=OpenBSD Secure Shell server |
- | alsa-utils | + | Documentation=man: |
- | anacron | + | After=network.target auditd.service |
- | atd | + | ConditionPathExists=!/ |
- | avahi-daemon | + | |
- | binfmt-support | + | [Service] |
- | bluetooth | + | EnvironmentFile=-/ |
- | bootlogd | + | ExecStartPre=/ |
- | bootlogs | + | ExecStart=/ |
- | bootmisc.sh | + | ExecReload=/ |
- | checkfs.sh | + | ExecReload=/ |
- | checkroot.sh | + | KillMode=process |
- | console-screen.sh | + | Restart=on-failure |
- | console-setup | + | RestartPreventExitStatus=255 |
- | cpufrequtils | + | Type=notify |
- | cron | + | RuntimeDirectory=sshd |
- | cups | + | RuntimeDirectoryMode=0755 |
- | dbus | + | |
- | exim4 | + | [Install] |
- | fancontrol | + | WantedBy=multi-user.target |
- | fuse | + | Alias=sshd.service |
- | gdm3 | + | |
- | halt | + | |
- | hdparm | + | |
- | hostname.sh rc | + | |
</ | </ | ||
- | ====Linux Standard Base==== | + | Dans le fichier on peut noter la présence des lignes suivantes dans la section **[Unit]** : |
- | **[[http:// | + | |
+ | * Cette directive est utilisée pour donner une courte description des fonctionnalités de l' | ||
+ | * **Documentation=man: | ||
+ | * Cette directive stipule les chapitres des manuels et les URLs contenant de l' | ||
+ | * **After=network.target auditd.service**, | ||
+ | * Cette directive indique les cibles qui devraient être atteintes et les Unités qui devraient être démarrées avant l' | ||
- | Les scripts init qui sont conformes au standard LSB doivent fournir | + | Dans le fichier on peut aussi noter la présence des lignes suivantes dans la section **[Service]** |
- | * au moins les actions | + | * **Type=notify**, |
- | * des codes retours standardisés, | + | |
- | * des informations sur des dépendances. | + | |
+ | * Cette directive définit l' | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | * **Restart=on-failure**, | ||
+ | * Cette ligne indique que le service doit être re-démarré en cas d' | ||
- | Les scripts init conforment au standard LSB peuvent aussi fournir | + | On note la présence de la ligne suivante dans la section **[Install]** |
- | * les actions | + | * **WantedBy=multi-user.target**, |
- | * des messages | + | * Cette directive indique la Cible dans laquelle le service doit être démarré. La présence |
- | ===Codes Retour Standardisés=== | + | < |
+ | root@debian11: | ||
+ | total 0 | ||
+ | lrwxrwxrwx 1 root root 35 Apr 25 06:47 anacron.service -> / | ||
+ | lrwxrwxrwx 1 root root 34 Apr 29 14:24 auditd.service -> / | ||
+ | lrwxrwxrwx 1 root root 40 Apr 25 06:51 avahi-daemon.service -> / | ||
+ | lrwxrwxrwx 1 root root 41 Apr 25 06:32 console-setup.service -> / | ||
+ | lrwxrwxrwx 1 root root 32 Apr 25 06:31 cron.service -> / | ||
+ | lrwxrwxrwx 1 root root 40 Apr 25 06:52 cups-browsed.service -> / | ||
+ | lrwxrwxrwx 1 root root 29 Apr 25 06:52 cups.path -> / | ||
+ | lrwxrwxrwx 1 root root 38 Apr 25 06:51 lm-sensors.service -> / | ||
+ | lrwxrwxrwx 1 root root 40 Apr 25 06:52 ModemManager.service -> / | ||
+ | lrwxrwxrwx 1 root root 38 Apr 25 06:31 networking.service -> / | ||
+ | lrwxrwxrwx 1 root root 42 Apr 25 06:52 NetworkManager.service -> / | ||
+ | lrwxrwxrwx 1 root root 36 Apr 25 06:30 remote-fs.target -> / | ||
+ | lrwxrwxrwx 1 root root 33 Apr 28 13:36 rsync.service -> / | ||
+ | lrwxrwxrwx 1 root root 35 Apr 25 06:31 rsyslog.service -> / | ||
+ | lrwxrwxrwx 1 root root 31 Apr 25 07:04 ssh.service -> / | ||
+ | lrwxrwxrwx 1 root root 42 Apr 25 06:51 wpa_supplicant.service -> / | ||
+ | </ | ||
- | Les codes retour standardisés sont : | + | Dernièrement, |
- | ^ Code Retour ^ Description ^ | + | * **Alias=sshd.service** |
- | | 0 | Le programme fonctionne et le service | + | |
- | | 1 | Le programme est mort et le fichier pid dans /var/run existe | | + | |
- | | 2 | Le programme est mort et le fichier verrou dans /var/lock existe | | + | |
- | | 3 | Le programme ne fonctionne pas et le service n'est pas correctement démarré | | + | |
- | | 4 | Le statut du programme ou du service est inconnu | | + | |
- | | 5 - 99 | Réservés pour LSB | | + | |
- | | 100-149 | Réserves pour la distribution | | + | |
- | | 150-199 | Réservés pour l' | + | |
- | | 200-254 | Réservés | | + | |
- | ===Scripts=== | + | Les alias se trouvent dans la répertoire **/ |
- | LSB stipule un format | + | < |
+ | root@debian11: | ||
+ | total 36 | ||
+ | lrwxrwxrwx 1 root root 42 Apr 25 06:51 dbus-fi.w1.wpa_supplicant1.service -> / | ||
+ | lrwxrwxrwx 1 root root 40 Apr 25 06:51 dbus-org.freedesktop.Avahi.service -> / | ||
+ | lrwxrwxrwx 1 root root 40 Apr 25 06:52 dbus-org.freedesktop.ModemManager1.service -> / | ||
+ | lrwxrwxrwx 1 root root 53 Apr 25 06:52 dbus-org.freedesktop.nm-dispatcher.service -> / | ||
+ | lrwxrwxrwx 1 root root 45 Apr 25 06:48 dbus-org.freedesktop.timesync1.service -> / | ||
+ | drwxr-xr-x 2 root root 4096 Apr 25 06:30 default.target.wants | ||
+ | lrwxrwxrwx 1 root root 35 Apr 25 06:53 display-manager.service -> / | ||
+ | drwxr-xr-x 2 root root 4096 Apr 25 06:30 getty.target.wants | ||
+ | drwxr-xr-x 2 root root 4096 Apr 25 06:50 graphical.target.wants | ||
+ | drwxr-xr-x 2 root root 4096 Apr 29 14:24 multi-user.target.wants | ||
+ | drwxr-xr-x 2 root root 4096 Apr 25 06:52 network-online.target.wants | ||
+ | drwxr-xr-x 2 root root 4096 Apr 25 06:52 printer.target.wants | ||
+ | drwxr-xr-x 2 root root 4096 Apr 26 13:47 sockets.target.wants | ||
+ | lrwxrwxrwx 1 root root 31 Apr 25 07:04 sshd.service -> / | ||
+ | drwxr-xr-x 2 root root 4096 Apr 26 13:47 sysinit.target.wants | ||
+ | lrwxrwxrwx 1 root root 35 Apr 25 06:31 syslog.service -> / | ||
+ | drwxr-xr-x 2 root root 4096 Apr 29 14:38 timers.target.wants | ||
+ | </ | ||
- | | + | Pour consulter |
- | | + | |
- | Par exemple | + | < |
+ | root@debian11: | ||
+ | Type=notify | ||
+ | Restart=on-failure | ||
+ | NotifyAccess=main | ||
+ | RestartUSec=100ms | ||
+ | TimeoutStartUSec=1min 30s | ||
+ | TimeoutStopUSec=1min 30s | ||
+ | TimeoutAbortUSec=1min 30s | ||
+ | TimeoutStartFailureMode=terminate | ||
+ | TimeoutStopFailureMode=terminate | ||
+ | RuntimeMaxUSec=infinity | ||
+ | WatchdogUSec=0 | ||
+ | WatchdogTimestampMonotonic=0 | ||
+ | RootDirectoryStartOnly=no | ||
+ | RemainAfterExit=no | ||
+ | GuessMainPID=yes | ||
+ | RestartPreventExitStatus=255 | ||
+ | MainPID=449 | ||
+ | ControlPID=0 | ||
+ | FileDescriptorStoreMax=0 | ||
+ | NFileDescriptorStore=0 | ||
+ | StatusErrno=0 | ||
+ | Result=success | ||
+ | ReloadResult=success | ||
+ | CleanResult=success | ||
+ | UID=[not set] | ||
+ | GID=[not set] | ||
+ | NRestarts=0 | ||
+ | OOMPolicy=stop | ||
+ | ExecMainStartTimestamp=Tue 2022-04-26 13:08:21 CEST | ||
+ | ExecMainStartTimestampMonotonic=7283003 | ||
+ | ExecMainExitTimestampMonotonic=0 | ||
+ | ExecMainPID=449 | ||
+ | ExecMainCode=0 | ||
+ | ExecMainStatus=0 | ||
+ | ExecStartPre={ path=/ | ||
+ | ExecStartPreEx={ path=/ | ||
+ | ExecStart={ path=/ | ||
+ | ExecStartEx={ path=/ | ||
+ | ExecReload={ path=/ | ||
+ | ExecReload={ path=/ | ||
+ | ExecReloadEx={ path=/ | ||
+ | ExecReloadEx={ path=/ | ||
+ | Slice=system.slice | ||
+ | ControlGroup=/ | ||
+ | MemoryCurrent=5832704 | ||
+ | CPUUsageNSec=664103000 | ||
+ | EffectiveCPUs= | ||
+ | EffectiveMemoryNodes= | ||
+ | TasksCurrent=1 | ||
+ | IPIngressBytes=[no data] | ||
+ | IPIngressPackets=[no data] | ||
+ | IPEgressBytes=[no data] | ||
+ | IPEgressPackets=[no data] | ||
+ | IOReadBytes=18446744073709551615 | ||
+ | IOReadOperations=18446744073709551615 | ||
+ | IOWriteBytes=18446744073709551615 | ||
+ | IOWriteOperations=18446744073709551615 | ||
+ | Delegate=no | ||
+ | lines 1-58 | ||
+ | [q] | ||
+ | </ | ||
+ | |||
+ | Pour consulter la liste des dépendances d'une Unité, il convient d' | ||
< | < | ||
- | [root@centos5 | + | root@debian11:~# systemctl list-dependencies sshd.service |
- | #!/bin/bash | + | sshd.service |
- | # | + | ● ├─-.mount |
- | # sshd Start up the OpenSSH server daemon | + | ● ├─system.slice |
- | # | + | ● └─sysinit.target |
- | # chkconfig: 2345 55 25 | + | ● |
- | # description: | + | ● |
- | # This service | + | ● |
- | # | + | ● |
- | # processname: | + | ● |
- | # config: / | + | ● |
- | # config: / | + | ● |
- | # config: / | + | ● |
- | # config: / | + | ● |
- | # pidfile: / | + | ● |
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● │ └─systemd-cryptsetup@sdc11.service | ||
+ | ● | ||
+ | ● │ ├─-.mount | ||
+ | ● │ ├─mnt-sdc11.mount | ||
+ | ● │ ├─systemd-fsck-root.service | ||
+ | ● │ └─systemd-remount-fs.service | ||
+ | ● | ||
+ | ● | ||
+ | </ | ||
- | ### BEGIN INIT INFO | + | ====LAB |
- | # Provides: sshd | + | |
- | # Required-Start: | + | |
- | # Required-Stop: | + | |
- | # Should-Start: | + | |
- | # Should-Stop: | + | |
- | # Default-Start: | + | |
- | # Default-Stop: 0 1 6 | + | |
- | # Short-Description: | + | |
- | # Description: | + | |
- | # This service starts up the OpenSSH server daemon. | + | |
- | ### END INIT INFO | + | |
- | # source function library | + | Pour avoir une évaluation du temps de démarrage, il convient |
- | . /etc/rc.d/ | + | |
- | # pull in sysconfig settings | + | < |
- | [ -f / | + | root@debian11: |
- | --Plus--(20%) | + | Startup finished in 3.197s |
+ | graphical.target reached after 4.567s in userspace | ||
</ | </ | ||
- | Les lignes | + | L' |
< | < | ||
- | # {MotClef}: valeur1 [valeur2...] | + | root@debian11: |
+ | 1.781s dev-sdb1.device | ||
+ | 1.645s man-db.service | ||
+ | 1.304s apparmor.service | ||
+ | 1.254s udisks2.service | ||
+ | 1.212s systemd-random-seed.service | ||
+ | 1.155s systemd-journal-flush.service | ||
+ | 1.027s NetworkManager-wait-online.service | ||
+ | 1.005s systemd-udevd.service | ||
+ | 876ms ModemManager.service | ||
+ | 645ms ssh.service | ||
+ | 608ms NetworkManager.service | ||
+ | 584ms polkit.service | ||
+ | 542ms logrotate.service | ||
+ | 469ms avahi-daemon.service | ||
+ | 449ms wpa_supplicant.service | ||
+ | 445ms systemd-logind.service | ||
+ | 441ms lightdm.service | ||
+ | 433ms plymouth-quit-wait.service | ||
+ | 410ms user@113.service | ||
+ | 372ms apt-daily.service | ||
+ | 358ms apt-daily-upgrade.service | ||
+ | 329ms packagekit.service | ||
+ | 313ms keyboard-setup.service | ||
+ | 299ms networking.service | ||
+ | 288ms systemd-timesyncd.service | ||
+ | 226ms systemd-tmpfiles-setup.service | ||
+ | 197ms systemd-modules-load.service | ||
+ | 196ms rsyslog.service | ||
+ | 184ms systemd-udev-trigger.service | ||
+ | 165ms e2scrub_reap.service | ||
+ | 164ms systemd-journald.service | ||
+ | 152ms user@1000.service | ||
+ | 108ms hddtemp.service | ||
+ | 101ms systemd-tmpfiles-setup-dev.service | ||
+ | 94ms systemd-sysusers.service | ||
+ | 93ms plymouth-start.service | ||
+ | 91ms lvm2-pvscan@8:41.service | ||
+ | 89ms systemd-update-utmp.service | ||
+ | 86ms systemd-remount-fs.service | ||
+ | 80ms lm-sensors.service | ||
+ | 72ms lvm2-pvscan@8: | ||
+ | 68ms systemd-sysctl.service | ||
+ | 67ms plymouth-read-write.service | ||
+ | 65ms lvm2-monitor.service | ||
+ | 63ms dev-hugepages.mount | ||
+ | 63ms sys-kernel-debug.mount | ||
+ | 62ms dev-mqueue.mount | ||
+ | 60ms sys-kernel-tracing.mount | ||
+ | 57ms lvm2-pvscan@8: | ||
+ | 41ms systemd-user-sessions.service | ||
+ | 33ms modprobe@fuse.service | ||
+ | 32ms sys-kernel-config.mount | ||
+ | 32ms ifupdown-pre.service | ||
+ | 27ms auditd.service | ||
+ | 27ms console-setup.service | ||
+ | 22ms rtkit-daemon.service | ||
+ | 20ms modprobe@configfs.service | ||
+ | 19ms sys-fs-fuse-connections.mount | ||
+ | lines 1-58 | ||
+ | [q] | ||
</ | </ | ||
- | <WRAP center round important> | + | L' |
- | **Important** : Notez qu'à part la deuxième ligne de la description, | + | |
- | </ | + | |
- | Les Mots Clefs sont : | + | < |
+ | root@debian11:~# systemd-analyze critical-chain sshd.service | ||
+ | The time when unit became active or started is printed after the " | ||
+ | The time the unit took to start is printed after the " | ||
- | ^ Mot Clef ^ Description ^ | + | ssh.service +645ms |
- | | Provides | Indique le service | + | └─network.target @3.425s |
- | | Required-start | Indique d' | + | └─NetworkManager.service |
- | | Required-Stop | Indique d' | + | └─dbus.service @2.812s |
- | | Should-Start | Indique d' | + | |
- | | Should-Stop | Indique d' | + | |
- | | Default-Start | Indique les niveaux d' | + | |
- | | Default-Stop | Indique les niveaux d' | + | |
- | | Short-Description | Indique une description du service | + | |
- | | Description | Indique une description multi-lignes du service. | + | |
+ | | ||
+ | | ||
+ | └─systemd-journald.socket @925ms | ||
+ | └─system.slice @487ms | ||
+ | └─-.slice @487ms | ||
+ | </ | ||
- | Il existe des groupements de services, appelés en anglais des //Virtual Facilities// | + | Les options de la commande **systemd-analyze** |
- | ^ Virtual Facility ^ Description ^ | + | < |
- | | $local_fs | Tous les systèmes de fichiers locaux doivent être montés. | | + | root@debian11: |
- | | $network | La carte Ethernet doit fonctionner | | + | systemd-analyze [OPTIONS...] COMMAND ... |
- | | $named | Les daemons, si présents, responsables de la résolution des noms tels DNS, NIS+ ou LDAP doivent être démarrés. | | + | |
- | | $portmap | Les daemons qui fournissent le // | + | |
- | | $remote_fs | Tous les systèmes de fichiers doivent être montés. | | + | |
- | | $syslog | Syslog, Syslog-ng ou Rsyslog doit être démarré. | | + | |
- | | $time | L' | + | |
- | ====Répertoires rcx.d==== | + | Profile systemd, show unit dependencies, |
- | Les répertoires **rc0.d** à **rc6.d** contiennent des liens vers les scripts du répertoire **init.d**. | + | Commands: |
+ | [time] | ||
+ | blame Print list of running units ordered by time to init | ||
+ | critical-chain [UNIT...] Print a tree of the time critical chain of units | ||
+ | plot | ||
+ | dot [UNIT...] | ||
+ | dump | ||
+ | cat-config | ||
+ | unit-files | ||
+ | unit-paths | ||
+ | exit-status [STATUS...] | ||
+ | capability [CAP...] | ||
+ | syscall-filter [NAME...] Print list of syscalls in seccomp filter | ||
+ | condition CONDITION... | ||
+ | verify FILE... | ||
+ | calendar SPEC... | ||
+ | timestamp TIMESTAMP... | ||
+ | timespan SPAN... | ||
+ | security [UNIT...] | ||
- | Pour mieux comprendre, saisissez les commandes suivantes | + | Options: |
+ | -h --help | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | -H --host=[USER@]HOST | ||
+ | -M --machine=CONTAINER | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | than the latest in the branch | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
- | < | + | See the systemd-analyze(1) man page for details. |
- | root@debian6:/ | + | |
- | dans /etc/rc2.d : | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | dans /etc/rc3.d : | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | dans /etc/rc4.d : | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | dans /etc/rc5.d : | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | /etc/rc5.d/S18exim4 | + | |
</ | </ | ||
- | <WRAP center round important> | + | ====LAB #5 - Les Cibles==== |
- | **Important** : Notez que chaque répertoire correspondant à un niveau d' | + | |
- | </ | + | |
- | Rappelez la commande précédente et modifiez la lettre S en **K** : | + | Chaque Cible est décrite par un fichier de configuration |
< | < | ||
- | root@debian6:/etc/init.d# for rep in /etc/rc[016].d; do echo "dans $rep :"; ls $rep/K*; done | + | root@debian11:~# cat /usr/lib/systemd/system/graphical.target |
- | dans /etc/rc0.d : | + | # SPDX-License-Identifier: LGPL-2.1-or-later |
- | / | + | # |
- | / | + | # This file is part of systemd. |
- | / | + | # |
- | / | + | # systemd is free software; you can redistribute it and/or modify it |
- | / | + | # under the terms of the GNU Lesser General Public License as published by |
- | / | + | # the Free Software Foundation; either version 2.1 of the License, or |
- | /etc/rc0.d/ | + | # (at your option) any later version. |
- | / | + | |
- | / | + | [Unit] |
- | / | + | Description=Graphical Interface |
- | / | + | Documentation=man: |
- | / | + | Requires=multi-user.target |
- | /etc/ | + | Wants=display-manager.service |
- | dans /etc/rc1.d : | + | Conflicts=rescue.service rescue.target |
- | / | + | After=multi-user.target rescue.service rescue.target display-manager.service |
- | /etc/rc1.d/ | + | AllowIsolate=yes |
- | / | + | |
- | / | + | |
- | / | + | |
- | /etc/rc1.d/ | + | |
- | / | + | |
- | /etc/rc1.d/ | + | |
- | dans /etc/rc6.d : | + | |
- | / | + | |
- | /etc/rc6.d/ | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | /etc/rc6.d/ | + | |
- | /etc/rc6.d/ | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
</ | </ | ||
+ | Dans ce fichier on peut noter la présence des lignes suivantes : | ||
- | <WRAP center round important> | + | * **Requires=multi-user.target**, |
- | **Important** : Ici le principe est le même sauf que la lettre | + | |
- | </ | + | |
+ | * Cette ligne indique | ||
+ | * **Conflicts=rescue.service rescue.target**, | ||
+ | * Cette ligne indique la Cible et le service en conflits | ||
+ | * **Wants=display-manager.service**, | ||
+ | * Cette ligne indique quel service doit être démarré. | ||
- | ===rc.local=== | + | ===5.1 - Contrôler les dépendances d'une Cible=== |
+ | |||
+ | Les dépendances d'une Cible peuvent être consultées en utilisant la commande **systemctl list-dependencies** : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | multi-user.target | ||
+ | ● ├─anacron.service | ||
+ | ● ├─auditd.service | ||
+ | ● ├─avahi-daemon.service | ||
+ | ● ├─console-setup.service | ||
+ | ● ├─cron.service | ||
+ | ● ├─cups-browsed.service | ||
+ | ● ├─cups.path | ||
+ | ● ├─dbus.service | ||
+ | ● ├─hddtemp.service | ||
+ | ● ├─lm-sensors.service | ||
+ | ● ├─ModemManager.service | ||
+ | ● ├─networking.service | ||
+ | ● ├─NetworkManager.service | ||
+ | ● ├─plymouth-quit-wait.service | ||
+ | ● ├─plymouth-quit.service | ||
+ | ● ├─rsync.service | ||
+ | ● ├─rsyslog.service | ||
+ | ● ├─ssh.service | ||
+ | ● ├─systemd-ask-password-wall.path | ||
+ | ● ├─systemd-logind.service | ||
+ | ● ├─systemd-update-utmp-runlevel.service | ||
+ | ● ├─systemd-user-sessions.service | ||
+ | ● ├─wpa_supplicant.service | ||
+ | ● ├─basic.target | ||
+ | ● │ ├─-.mount | ||
+ | ● │ ├─tmp.mount | ||
+ | ● │ ├─paths.target | ||
+ | ● │ ├─slices.target | ||
+ | ● │ │ ├─-.slice | ||
+ | ● │ │ └─system.slice | ||
+ | ● │ ├─sockets.target | ||
+ | ● │ │ ├─avahi-daemon.socket | ||
+ | ● │ │ ├─cups.socket | ||
+ | ● │ │ ├─dbus.socket | ||
+ | ● │ │ ├─dm-event.socket | ||
+ | ● │ │ ├─systemd-initctl.socket | ||
+ | ● │ │ ├─systemd-journald-audit.socket | ||
+ | ● │ │ ├─systemd-journald-dev-log.socket | ||
+ | ● │ │ ├─systemd-journald.socket | ||
+ | ● │ │ ├─systemd-udevd-control.socket | ||
+ | ● │ │ └─systemd-udevd-kernel.socket | ||
+ | ● │ ├─sysinit.target | ||
+ | ● │ │ ├─apparmor.service | ||
+ | ● │ │ ├─blk-availability.service | ||
+ | ● │ │ ├─dev-hugepages.mount | ||
+ | ● │ │ ├─dev-mqueue.mount | ||
+ | ● │ │ ├─keyboard-setup.service | ||
+ | ● │ │ ├─kmod-static-nodes.service | ||
+ | ● │ │ ├─lvm2-lvmpolld.socket | ||
+ | ● │ │ ├─lvm2-monitor.service | ||
+ | ● │ │ ├─plymouth-read-write.service | ||
+ | ● │ │ ├─plymouth-start.service | ||
+ | ● │ │ ├─proc-sys-fs-binfmt_misc.automount | ||
+ | ● │ │ ├─sys-fs-fuse-connections.mount | ||
+ | ● │ │ ├─sys-kernel-config.mount | ||
+ | ● │ │ ├─sys-kernel-debug.mount | ||
+ | ● │ │ ├─sys-kernel-tracing.mount | ||
+ | lines 1-58 | ||
+ | [q] | ||
+ | </ | ||
- | Le script rc.local est lancé | + | Les points noirs au début de chaque ligne dans la sortie ci-dessus peuvent être de trois couleurs différentes : |
- | ====La commande chkconfig==== | + | * **Vert** implique que le service, la cible ou l' |
+ | * **Blanc** implique le service, la cible ou l' | ||
+ | * **Rouge** implique que le service, la cible ou l' | ||
- | Sous Debian la commande **chkconfig** n'est pas installée par défaut. Il convient donc de l' | + | Pour visualiser les Unités en état d'erreur fatale, utilisez |
< | < | ||
- | root@debian6:/etc/init.d# apt-get install chkconfig | + | root@debian11:~# systemctl |
- | Lecture des listes de paquets... Fait | + | |
- | Construction de l' | + | 0 loaded units listed. |
- | Lecture des informations d' | + | |
- | Les NOUVEAUX paquets suivants seront installés : | + | |
- | | + | |
- | 0 mis à jour, 1 nouvellement installés, 0 à enlever et 219 non mis à jour. | + | |
- | Il est nécessaire de prendre 9 182 o dans les archives. | + | |
- | Après cette opération, 69,6 ko d' | + | |
- | Réception de : 1 http:// | + | |
- | 9 182 o réceptionnés en 50s (183 o/s) | + | |
- | (Lecture de la base de données... 130287 fichiers et répertoires déjà installés.) | + | |
- | Dépaquetage de chkconfig (à partir de .../ | + | |
- | Traitement des actions différées (« triggers ») pour « man-db »... | + | |
- | Paramétrage de chkconfig (11.0-79.1-2) ... | + | |
</ | </ | ||
- | Saisissez maintenant | + | Les dépendances sont créés sous la forme de liens symboliques dans les répertoires **/ |
< | < | ||
- | root@debian6:/tmp# chkconfig | + | root@debian11:~# ls -l / |
- | acpid 0: | + | total 0 |
- | alsa-utils 0:off 1:off 2:off 3:off 4:off 5:off 6:off S:on | + | lrwxrwxrwx |
- | anacron | + | lrwxrwxrwx |
- | atd | + | lrwxrwxrwx |
- | avahi-daemon | + | lrwxrwxrwx |
- | binfmt-support | + | lrwxrwxrwx |
- | bluetooth | + | lrwxrwxrwx |
- | bootlogd | + | lrwxrwxrwx |
- | bootlogs | + | lrwxrwxrwx |
- | bootmisc.sh | + | lrwxrwxrwx |
- | checkfs.sh | + | lrwxrwxrwx |
- | checkroot.sh | + | lrwxrwxrwx |
- | console-screen.sh | + | lrwxrwxrwx |
- | console-setup | + | lrwxrwxrwx |
- | cpufrequtils | + | lrwxrwxrwx |
- | cron | + | lrwxrwxrwx |
- | cups 0:off 1:off 2:on | + | lrwxrwxrwx |
- | dbus 0:off 1:off 2:on | + | |
- | exim4 | + | root@debian11:~# ls -l / |
- | fancontrol | + | total 0 |
- | fuse 0:off 1:off 2:off 3:off 4:off 5:off 6:off S:on | + | lrwxrwxrwx |
- | gdm3 0:off 1:off 2:on | + | lrwxrwxrwx |
- | hdparm | + | lrwxrwxrwx |
- | hostname.sh | + | lrwxrwxrwx |
- | hwclock.sh 0:off 1:off 2:off 3:off 4:off 5:off 6:off S:on | + | lrwxrwxrwx |
- | hwclockfirst.sh | + | lrwxrwxrwx |
- | ifupdown | + | lrwxrwxrwx |
- | ifupdown-clean 0:off 1:off 2:off 3:off 4:off 5:off 6:off S:on | + | lrwxrwxrwx |
- | kerneloops | + | |
- | keyboard-setup 0:off 1:off 2:off 3:off 4:off 5:off 6:off S:on | + | |
- | killprocs | + | |
- | lm-sensors | + | |
- | loadcpufreq | + | |
- | module-init-tools | + | |
- | mountall-bootclean.sh | + | |
- | mountall.sh | + | |
- | mountdevsubfs.sh | + | |
- | mountkernfs.sh 0:off 1:off 2:off 3:off 4:off 5:off 6:off S:on | + | |
- | mountnfs-bootclean.sh | + | |
- | mountnfs.sh | + | |
- | mountoverflowtmp | + | |
- | mtab.sh | + | |
- | network-manager | + | |
- | networking | + | |
- | nfs-common | + | |
- | portmap | + | |
- | pppd-dns 0:off 1:off 2:off 3:off 4:off 5:off 6:off S:on | + | |
- | procps | + | |
- | rc.local 0:off 1:off 2:on | + | |
- | rcS 0:off 1:off 2:off 3:off 4:off 5:off 6:off | + | |
- | rmnologin | + | |
- | rsyslog | + | |
- | saned | + | |
- | sendsigs | + | |
- | stop-bootlogd | + | |
- | stop-bootlogd-single | + | |
- | sudo 0: | + | |
- | udev 0:off 1:off 2:off 3:off 4:off 5:off 6:off S:on | + | |
- | udev-mtab | + | |
- | umountfs | + | |
- | umountnfs.sh 0:off 1:off 2:off 3:off 4:off 5:off 6:off | + | |
- | umountroot | + | |
- | unattended-upgrades | + | |
- | urandom | + | |
- | vboxadd | + | |
- | vboxadd-service | + | |
- | vboxadd-x11 | + | |
- | x11-common | + | |
</ | </ | ||
- | ===Options de la commande=== | + | ===5.2 - La Cible par Défaut=== |
- | Les options de la commande **chkconfig** sont : | + | ==Consulter la Cible par Défaut== |
+ | |||
+ | Pour consulter la cible par défaut, il convient d' | ||
< | < | ||
- | root@debian6:/tmp# chkconfig | + | root@debian11:~# systemctl get-default |
- | usage: | + | graphical.target |
- | chkconfig -A|--allservices | + | </ |
- | chkconfig -t|--terse [names] | + | |
- | chkconfig -e|--edit | + | |
- | chkconfig -s|--set | + | |
- | | + | |
- | chkconfig -c|--check name [state] | + | |
- | chkconfig -a|--add | + | |
- | chkconfig -d|--del | + | |
- | chkconfig -h|--help | + | |
- | chkconfig -f|--force ... (call insserv with -f) | + | |
- | chkconfig [name] | + | ==Modifier la Cible par Défaut== |
- | | + | |
+ | Pour modifier la Cible par défaut avec une prise en compte lors du **prochain** démarrage, il convient d' | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | -rw-r--r-- 1 root root 540 Feb 2 2021 / | ||
+ | root@debian11: | ||
+ | Created symlink / | ||
</ | </ | ||
- | Les options les plus importantes sont : | + | ==Modifier la Cible en Cours== |
- | ^ Option ^ Description ^ | + | Il est possible |
- | | - -add (nom) | Permet d' | + | |
- | | - -del (nom) | Permet | + | |
- | | %%- -level [niveau] (nom) [on|off|reset]%% | + | |
- | ====La commande update-rc.d sous Debian 6==== | + | < |
+ | root@debian11: | ||
- | La commande **update-rc.d** est utilisée pour gérer les liens dans les répertoires rc[x].d. Cette commande permet d' | + | root@debian11: |
+ | rescue.target | ||
- | < | + | root@debian11: |
- | update-rc.d < | + | 5 1 |
- | </ | + | |
- | Par exemple la commande suivante crée les liens **S** dans rc2.d à rc5.d avec une priorité de 20 et les liens **K** dans rc0.d, rc1.d et rc6.d avec une priorité de 20 pour le script / | + | root@debian11:~# who -r |
+ | | ||
- | | + | root@debian11: |
- | <WRAP center round important> | + | root@debian11:~# systemctl list-units --type target | egrep " |
- | **Important** | + | multi-user.target |
- | Il existe aussi un mot clef : **default**. Ce mot clef indique à **update-rc.d** d' | + | |
- | </ | + | |
- | Pour supprimer les liens il convient d' | + | root@debian11:~# runlevel |
+ | 1 3 | ||
- | | + | root@debian11: |
+ | run-level 3 2022-04-30 12:21 | ||
+ | </ | ||
- | <WRAP center round important> | + | ====LAB #6 - Gestion des Services==== |
- | **Important** : | + | |
- | Cette commande laisse le script ssh dans le répertoire / | + | |
- | </ | + | |
- | ===Options de la commande=== | + | ===6.1 - Gestion des Instances Uniques=== |
- | Les options de cette commande sont : | + | Commencez par installer le paquet **apache2** |
< | < | ||
- | root@debian:/etc/init.d# update-rc.d --help | + | root@debian11:~# apt install |
- | update-rc.d: | + | |
- | update-rc.d: | + | |
- | usage: update-rc.d [-n] [-f] < | + | |
- | | + | |
- | | + | |
- | | + | |
- | -n: not really | + | |
- | -f: force | + | |
- | + | ||
- | The disable|enable API is not stable and might change in the future. | + | |
</ | </ | ||
- | =====Démarrer Debian 8 avec systemd===== | + | Pour obtenir le détail sur un service donné, il convient d' |
- | Debian 8, comme beaucoup d' | + | < |
+ | root@debian11: | ||
+ | ● apache2.service | ||
+ | | ||
+ | | ||
+ | Docs: https:// | ||
+ | Main PID: 56037 (apache2) | ||
+ | Tasks: 55 (limit: 4663) | ||
+ | | ||
+ | CPU: 38ms | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
- | Au lieu de parler de scripts de démarrage et de niveaux d' | + | Apr 30 12:22:50 debian11 systemd[1]: Starting The Apache HTTP Server... |
+ | Apr 30 12:22:50 debian11 systemd[1]: Started The Apache HTTP Server. | ||
+ | </ | ||
- | * un automount | + | Dans le cas du service apache2 ci-dessus, on peut constater que le statut est **enabled**. Le statut peut être une de 2 valeurs : |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | * un service - //Service// - (.service), | + | |
- | * une instantanée - // | + | |
- | * une cible - //Target// - (.target). | + | |
- | <WRAP center round important> | + | |
- | **Important** : Dans le contexte d'une Unité, le type **cible** regroupe des Unités multiples afin qu' | + | |
- | </ | + | |
- | ====La Commande systemctl==== | + | Il est possible de vérifier le statut en utilisant le commande **systemctl |
- | + | ||
- | Pour visualiser la liste des Unités, il convient d' | + | |
< | < | ||
- | root@debian8:~# systemctl | + | root@debian11:~# systemctl |
- | UNIT | + | enabled |
- | proc-sys-fs-binfmt_misc.automount | + | |
- | sys-devices-pci0000: | + | |
- | sys-devices-pci0000: | + | |
- | sys-devices-pci0000: | + | |
- | sys-devices-pci0000: | + | |
- | sys-devices-pci0000: | + | |
- | sys-devices-pci0000: | + | |
- | sys-devices-pci0000: | + | |
- | sys-devices-platform-serial8250-tty-ttyS0.device | + | |
- | sys-devices-platform-serial8250-tty-ttyS1.device | + | |
- | sys-devices-platform-serial8250-tty-ttyS2.device | + | |
- | sys-devices-platform-serial8250-tty-ttyS3.device | + | |
- | sys-module-fuse.device | + | |
- | sys-subsystem-net-devices-eth0.device | + | |
- | -.mount | + | |
- | dev-hugepages.mount | + | |
- | dev-mqueue.mount | + | |
- | etc-machine\x2did.mount | + | |
- | run-rpc_pipefs.mount | + | |
- | run-user-1000.mount | + | |
- | run-user-120.mount | + | |
- | sys-fs-fuse-connections.mount | + | |
- | sys-kernel-debug.mount | + | |
- | cups.path | + | |
- | systemd-ask-password-console.path | + | |
- | systemd-ask-password-wall.path | + | |
- | session-2.scope | + | |
- | session-c1.scope | + | |
- | accounts-daemon.service | + | |
- | atd.service | + | |
- | lines 1-31 | + | |
</ | </ | ||
- | Pour consulter la liste des Unités inactifs, utilisez | + | Pour rendre le statut **disabled**, il convient d' |
< | < | ||
- | root@debian8:~# systemctl | + | root@debian11:~# systemctl |
- | proc-sys-fs-binfmt_misc.mount loaded | + | Synchronizing state of apache2.service with SysV service script with / |
- | ats File System | + | Executing: / |
- | run-vmblock\x2dfuse.mount loaded | + | Removed / |
- | sys-kernel-config.mount loaded | + | |
- | | + | root@debian11: |
- | ● var-lock.mount | + | disabled |
- | ● var-run.mount not-found inactive dead var-run.mount | + | |
- | systemd-ask-password-plymouth.path | + | root@debian11: |
- | lymouth Directory Watch | + | ● apache2.service - The Apache HTTP Server |
- | alsa-restore.service | + | Loaded: |
- | alsa-state.service | + | Active: active (running) since Sat 2022-04-30 12:22:50 CEST; 3min 6s ago |
- | re and store) | + | Docs: https:// |
- | alsa-store.service | + | Main PID: 56037 (apache2) |
- | | + | |
- | ● bootmisc.service | + | Memory: 8.8M |
- | ● clamav-daemon.service | + | CPU: 46ms |
- | ● console-screen.service | + | |
- | | + | ├─56037 / |
- | work better on Debian | + | ├─56039 / |
- | emergency.service | + | |
- | ● festival.service | + | |
- | getty-static.service | + | Apr 30 12:22:50 debian11 systemd[1]: Starting The Apache HTTP Server... |
- | logind are not available | + | Apr 30 12:22:50 debian11 systemd[1]: Started The Apache HTTP Server. |
- | ● greylist.service | + | |
- | ● keymap.service | + | |
- | ● mountkernfs.service | + | |
- | ● mysql.service | + | |
- | open-vm-tools.service | + | |
- | osted on VMware | + | |
- | | + | |
- | to Quit | + | |
- | --More-- | + | |
</ | </ | ||
- | Pour consulter la liste des fichiers Unités, utilisez la commande | + | Dans le cas du service httpd ci-dessus, on peut constater que l' |
+ | |||
+ | * **inactive (dead)** - le service est arrêté. | ||
+ | * **active(running)** - le service est démarré avec un ou plusieurs processus. | ||
+ | * **active(exited)** - le service a terminé une configuration unique. | ||
+ | * **active(waiting)** - le service est démarré mais en attente d'un évènement. | ||
+ | * **activating** - le service est en cours d' | ||
+ | * **deactivating** - le service est en cours de désactivation. | ||
+ | * **failed** - le service a rencontré une erreur fatale. | ||
+ | |||
+ | Il est possible de vérifier l' | ||
< | < | ||
- | root@debian8:~# systemctl | + | root@debian11:~# systemctl |
- | UNIT FILE STATE | + | active |
- | proc-sys-fs-binfmt_misc.automount | + | |
- | dev-hugepages.mount | + | |
- | dev-mqueue.mount | + | |
- | proc-sys-fs-binfmt_misc.mount | + | |
- | run-vmblock\x2dfuse.mount | + | |
- | sys-fs-fuse-connections.mount | + | |
- | sys-kernel-config.mount | + | |
- | sys-kernel-debug.mount | + | |
- | tmp.mount | + | |
- | cups.path | + | |
- | systemd-ask-password-console.path | + | |
- | systemd-ask-password-plymouth.path | + | |
- | systemd-ask-password-wall.path | + | |
- | session-2.scope | + | |
- | session-c1.scope | + | |
- | accounts-daemon.service | + | |
- | alsa-restore.service | + | |
- | alsa-state.service | + | |
- | alsa-store.service | + | |
- | alsa-utils.service | + | |
- | anacron-resume.service | + | |
- | anacron.service | + | |
- | atd.service | + | |
- | auditd.service | + | |
- | autovt@.service | + | |
- | avahi-daemon.service | + | |
- | bluetooth.service | + | |
- | bootlogd.service | + | |
- | bootlogs.service | + | |
- | bootmisc.service | + | |
- | --More-- | + | |
</ | </ | ||
- | ===Options de la Commande systemctl=== | + | Pour rendre l' |
- | Les options de la commande **systemctl** sont : | + | < |
+ | root@debian11: | ||
+ | </ | ||
+ | |||
+ | Vérifiez ensuite l' | ||
< | < | ||
- | root@debian8:~# systemctl --help | + | root@debian11:~# systemctl |
- | systemctl [OPTIONS...] {COMMAND} ... | + | inactive |
- | Query or send control commands to the systemd | + | root@debian11: |
+ | ● apache2.service - The Apache HTTP Server | ||
+ | | ||
+ | | ||
+ | Docs: https:// | ||
+ | Process: 56435 ExecStop=/ | ||
+ | Main PID: 56037 (code=exited, | ||
+ | CPU: 77ms | ||
- | -h --help | + | Apr 30 12:22:50 debian11 systemd[1]: Starting The Apache HTTP Server... |
- | --version | + | Apr 30 12:22:50 debian11 systemd[1]: Started The Apache HTTP Server. |
- | --system | + | Apr 30 12:27:53 debian11 systemd[1]: Stopping The Apache HTTP Server... |
- | | + | Apr 30 12:27:53 debian11 systemd[1]: apache2.service: |
- | -H --host=[USER@]HOST | + | Apr 30 12:27:53 debian11 systemd[1]: Stopped The Apache HTTP Server. |
- | Operate on remote host | + | |
- | -M --machine=CONTAINER | + | |
- | Operate on local container | + | |
- | -t --type=TYPE | + | |
- | | + | |
- | -p --property=NAME | + | |
- | -a --all Show all loaded units/ | + | |
- | ones. To list all units installed on the system, use | + | |
- | the ' | + | |
- | -l --full | + | |
- | -r --recursive | + | |
- | | + | |
- | | + | |
- | queueing a new job | + | |
- | | + | |
- | -i --ignore-inhibitors | + | |
- | When shutting down or sleeping, ignore inhibitors | + | |
- | | + | |
- | -s --signal=SIGNAL | + | |
- | -q --quiet | + | |
- | | + | |
- | | + | |
- | lines 1-31 | + | |
</ | </ | ||
- | ====Fichiers | + | Pour démarrer une Unité |
- | + | ||
- | Les Cibles et les Unités sont configurées par des fichiers se trouvant dans le répertoire **/ | + | |
< | < | ||
- | root@debian8:~# ls -l / | + | root@debian11:~# systemctl start apache2.service |
- | total 52 | + | |
- | drwxr-xr-x 2 root root 4096 Oct 23 16:34 bluetooth.target.wants | + | root@debian11:~# systemctl status apache2.service |
- | lrwxrwxrwx 1 root root 37 Oct 23 16:34 dbus-org.bluez.service -> / | + | ● apache2.service - The Apache HTTP Server |
- | lrwxrwxrwx 1 root root 40 Oct 23 16:34 dbus-org.freedesktop.Avahi.service | + | |
- | lrwxrwxrwx 1 root root 40 Oct 23 16:34 dbus-org.freedesktop.ModemManager1.service -> /lib/systemd/ | + | Active: active (running) since Sat 2022-04-30 12:30:17 CEST; 2s ago |
- | lrwxrwxrwx 1 root root 53 Oct 23 16:34 dbus-org.freedesktop.nm-dispatcher.service -> /lib/systemd/system/ | + | Docs: https://httpd.apache.org/docs/2.4/ |
- | lrwxrwxrwx 1 root root 35 Oct 23 16:34 display-manager.service -> /lib/systemd/system/lightdm.service | + | |
- | drwxr-xr-x 2 root root 4096 Oct 23 16:34 getty.target.wants | + | Main PID: 56452 (apache2) |
- | drwxr-xr-x 2 root root 4096 Oct 23 16:34 graphical.target.wants | + | Tasks: 55 (limit: 4663) |
- | drwxr-xr-x 2 root root 4096 Oct 23 16:34 halt.target.wants | + | Memory: 8.7M |
- | drwxr-xr-x 2 root root 4096 Oct 23 16:34 hibernate.target.wants | + | CPU: 35ms |
- | drwxr-xr-x 2 root root 4096 Oct 23 16:34 hybrid-sleep.target.wants | + | CGroup: /system.slice/ |
- | drwxr-xr-x 2 root root 4096 Oct 28 06:37 multi-user.target.wants | + | ├─56452 / |
- | drwxr-xr-x 2 root root 4096 Oct 23 16:34 paths.target.wants | + | ├─56453 / |
- | drwxr-xr-x 2 root root 4096 Oct 23 16:34 poweroff.target.wants | + | └─56454 / |
- | drwxr-xr-x 2 root root 4096 Oct 23 16:34 printer.target.wants | + | |
- | drwxr-xr-x 2 root root 4096 Oct 23 16:34 reboot.target.wants | + | Apr 30 12:30:17 debian11 systemd[1]: Starting The Apache HTTP Server... |
- | drwxr-xr-x 2 root root 4096 Oct 23 16:34 sockets.target.wants | + | Apr 30 12:30:17 debian11 systemd[1]: Started The Apache HTTP Server. |
- | lrwxrwxrwx | + | |
- | drwxr-xr-x 2 root root 4096 Oct 23 16:34 suspend.target.wants | + | |
- | lrwxrwxrwx | + | |
</ | </ | ||
- | ainsi que par des fichiers se trouvant dans le répertoire | + | Pour activer un service au prochain démarrage du système, utilisez l' |
< | < | ||
- | root@debian8:~# ls -l / | + | root@debian11:~# systemctl enable apache2.service |
- | total 904 | + | Synchronizing state of apache2.service with SysV service script with / |
- | -rw-r--r-- 1 root root 411 Oct 1 2014 accounts-daemon.service | + | Executing: / |
- | -rw-r--r-- 1 root root 476 Jul 8 2014 alsa-restore.service | + | |
- | -rw-r--r-- 1 root root 526 Jul 8 2014 alsa-state.service | + | Created symlink / |
- | -rw-r--r-- 1 root root 373 Jul 8 2014 alsa-store.service | + | root@debian11: |
- | lrwxrwxrwx 1 root root 9 Oct 23 16:34 alsa-utils.service | + | ● apache2.service - The Apache HTTP Server |
- | -rw-r--r-- 1 root root 283 Dec 28 2014 anacron-resume.service | + | Loaded: loaded (/ |
- | -rw-r--r-- 1 root root 183 Dec 28 2014 anacron.service | + | Active: active (running) since Sat 2022-04-30 12:30:17 CEST; 1min 5s ago |
- | -rw-r--r-- 1 root root 169 Sep 30 2014 atd.service | + | Docs: https://httpd.apache.org/docs/2.4/ |
- | -rw-r--r-- 1 root root 688 Dec 9 2014 auditd.service | + | Main PID: 56452 (apache2) |
- | lrwxrwxrwx 1 root root 14 Aug 31 00:04 autovt@.service -> getty@.service | + | Tasks: 55 (limit: 4663) |
- | -rw-r--r-- 1 root root 1044 Apr 14 2015 avahi-daemon.service | + | Memory: 8.7M |
- | -rw-r--r-- 1 root root 874 Apr 14 2015 avahi-daemon.socket | + | CPU: 39ms |
- | -rw-r--r-- 1 root root 524 Aug 31 00:04 basic.target | + | CGroup: /system.slice/apache2.service |
- | drwxr-xr-x 2 root root 4096 Oct 23 16:34 basic.target.wants | + | |
- | -rw-r--r-- 1 root root 338 Jan 3 2015 bluetooth.service | + | ├─56453 |
- | -rw-r--r-- 1 root root 379 Aug 31 00:04 bluetooth.target | + | └─56454 / |
- | lrwxrwxrwx 1 root root 9 Aug 31 00:04 bootlogd.service -> /dev/null | + | |
- | lrwxrwxrwx 1 root root 9 Aug 31 00:04 bootlogs.service -> /dev/null | + | Apr 30 12:30:17 debian11 systemd[1]: Starting The Apache HTTP Server... |
- | lrwxrwxrwx 1 root root 9 Aug 31 00:04 bootmisc.service -> /dev/null | + | Apr 30 12:30:17 debian11 systemd[1]: Started The Apache HTTP Server. |
- | lrwxrwxrwx 1 root root 9 Aug 31 00:04 checkfs.service -> /dev/null | + | |
- | lrwxrwxrwx 1 root root 9 Aug 31 00:04 checkroot-bootclean.service | + | |
- | lrwxrwxrwx 1 root root 9 Aug 31 00:04 checkroot.service -> /dev/null | + | |
- | -rw-r--r-- 1 root root 298 Dec 9 2014 colord.service | + | |
- | -rw-r--r-- 1 root root 150 Oct 23 2014 configure-printer@.service | + | |
- | -rw-r--r-- 1 root root 737 Aug 31 00:04 console-getty.service | + | |
- | -rw-r--r-- 1 root root 741 Aug 31 00:04 console-shell.service | + | |
- | -rw-r--r-- 1 root root 783 Aug 31 00:04 container-getty@.service | + | |
- | -rw-r--r-- | + | |
- | lrwxrwxrwx 1 root root 9 Aug 31 00:04 cryptdisks-early.service -> /dev/null | + | |
- | lrwxrwxrwx | + | |
- | --More-- | + | |
</ | </ | ||
- | Par exemple, sous Debian 8, le service | + | ===6.2 - Gestion d' |
+ | |||
+ | Systemd permet l' | ||
< | < | ||
- | root@debian8:~# cat /etc/ | + | root@debian11:~# cat /usr/lib/ |
[Unit] | [Unit] | ||
- | Description=OpenBSD Secure Shell server | + | Description=The Apache HTTP Server |
- | After=network.target | + | After=network.target |
- | ConditionPathExists=!/etc/ssh/sshd_not_to_be_run | + | ConditionPathIsDirectory=/etc/apache2-%i |
+ | Documentation=https:// | ||
[Service] | [Service] | ||
- | EnvironmentFile=-/etc/default/ssh | + | Type=forking |
- | ExecStart=/ | + | Environment=APACHE_CONFDIR=/etc/apache2-%i APACHE_STARTED_BY_SYSTEMD=true |
- | ExecReload=/ | + | ExecStart=/ |
- | KillMode=process | + | ExecStop=/ |
- | Restart=on-failure | + | ExecReload=/ |
+ | KillMode=mixed | ||
+ | PrivateTmp=true | ||
+ | Restart=on-abort | ||
[Install] | [Install] | ||
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
- | Alias=sshd.service | ||
</ | </ | ||
- | Dans ce fichier on peut noter la présence des lignes suivantes | + | Une instance créée à partir de ce gabarit devrait avoir un nom sous la forme suivante |
- | * **ExecStart=/ | + | < |
- | * Cette ligne définit l' | + | apache2@< |
- | * **After=network.target auditd.service**, | + | </ |
- | * Cette ligne indique les services qui devraient être démarrés avant le démarrage de sshd, | + | |
- | * **WantedBy=multi-user.target**, | + | |
- | * Cette ligne indique la Cible dans laquelle le service doit être démarré, | + | |
- | * **Restart=on-failure**, | + | |
- | * Cette ligne indique quand le service doit être re-démarré. | + | |
- | ====Système | + | Dans ce fichier on peut constater l' |
- | **Systemd** utilise des Cibles d'une manière similaire | + | |
+ | | ||
+ | | ||
+ | * %P : est remplacé par le préfixe non-échappé de l'Unité, c' | ||
+ | * %i : est remplacé par le nom de l' | ||
+ | * %I : est remplacé par le nom de l' | ||
+ | * %f : est remplacé par le préfixe non-échappé ou le nom de l' | ||
+ | * %c : est remplacé par le CGroup de l' | ||
+ | * %u : est remplacé par le nom de l' | ||
+ | | ||
+ | | ||
+ | | ||
- | | + | Créez maintenant deux copies du fichier |
- | | + | |
- | | + | |
- | | + | |
- | * runlevel4.target, | + | |
- | * runlevel5.target, | + | |
- | * runlevel6.target. | + | |
- | Ceci étant il y principalement deux Cibles finales | + | < |
+ | root@debian11:~# cp / | ||
+ | root@debian11: | ||
+ | </ | ||
- | | + | Copiez le répertoire |
- | | + | |
- | Chaque Cible est décrite par un fichier | + | < |
+ | root@debian11: | ||
+ | root@debian11: | ||
+ | </ | ||
+ | |||
+ | Editez le fichier | ||
< | < | ||
- | root@debian8:~# cat /lib/systemd/system/ | + | root@debian11:~# vi /etc/apache2-instance01/ports.conf |
- | # This file is part of systemd. | + | root@debian11: |
- | # | + | # If you just change the port or add more ports here, you will likely also |
- | # systemd is free software; | + | # have to change |
- | # | + | # / |
- | # the Free Software Foundation; either version 2.1 of the License, or | + | |
- | # (at your option) any later version. | + | |
- | [Unit] | + | Listen 81 |
- | Description=Graphical Interface | + | |
- | Documentation=man: | + | |
- | Requires=multi-user.target | + | |
- | After=multi-user.target | + | |
- | Conflicts=rescue.target | + | |
- | Wants=display-manager.service | + | |
- | AllowIsolate=yes | + | |
- | </ | + | |
- | Dans ce fichier on peut noter la présence des lignes suivantes : | + | < |
+ | Listen 443 | ||
+ | </ | ||
- | * **Requires=multi-user.target**, | + | < |
- | * Cette ligne indique que le **graphical.target** ne peut pas être atteint si le **multi-user.target** n'a pas été atteint aupréalable, | + | |
- | * **After=multi-user.target**, | + | </ |
- | * Cette ligne indique le **multi-user.target** doit d' | + | |
- | * **Conflicts=rescue.target**, | + | |
- | * Cette ligne indique la Cible en conflit avec le **graphical.target**, | + | |
- | * **Wants=display-manager.service**, | + | |
- | * Cette ligne indique quel service doit être démarré. | + | |
- | Dernièrement, | + | # vim: syntax=apache ts=4 sw=4 sts=4 sr noet |
+ | </ | ||
+ | |||
+ | Editez | ||
< | < | ||
- | root@debian8:~# ls -l /lib/systemd/system/ | + | root@debian11:~# vi /etc/apache2-instance02/ports.conf |
- | lrwxrwxrwx 1 root root 16 Aug 31 00:04 /lib/systemd/system/ | + | root@debian11:~# cat /etc/apache2-instance02/ports.conf |
- | </code> | + | # If you just change the port or add more ports here, you will likely also |
+ | # have to change the VirtualHost statement in | ||
+ | # /etc/ | ||
- | ====La Commande systemd-analyze==== | + | Listen 82 |
- | Pour avoir une évaluation du temps de démarrage, il convient d' | + | < |
+ | Listen 443 | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | Listen 443 | ||
+ | </ | ||
- | < | + | # vim: syntax=apache ts=4 sw=4 sts=4 sr noet |
- | root@debian8: | + | |
- | Startup finished in 6.296s (kernel) + 17.035s (userspace) | + | |
</ | </ | ||
- | L' | + | Editez la directive |
< | < | ||
- | root@debian8:~# systemd-analyze blame | + | root@debian11:~# vi / |
- | | + | root@debian11: |
- | 6.781s ModemManager.service | + | # envvars |
- | 6.672s exim4.service | + | |
- | 5.483s accounts-daemon.service | + | |
- | | + | |
- | 3.697s pppd-dns.service | + | |
- | 3.587s systemd-logind.service | + | |
- | 3.554s vboxadd-x11.service | + | |
- | 3.545s vboxadd.service | + | |
- | 3.543s rc-local.service | + | |
- | 3.539s minissdpd.service | + | |
- | 3.538s irqbalance.service | + | |
- | 3.527s gdomap.service | + | |
- | 3.527s speech-dispatcher.service | + | |
- | 3.461s avahi-daemon.service | + | |
- | 2.895s networking.service | + | |
- | 2.726s kbd.service | + | |
- | 1.652s polkitd.service | + | |
- | 1.459s keyboard-setup.service | + | |
- | 1.434s lightdm.service | + | |
- | 1.055s rsyslog.service | + | |
- | 955ms systemd-tmpfiles-setup.service | + | |
- | 864ms systemd-modules-load.service | + | |
- | 830ms vboxadd-service.service | + | |
- | 778ms systemd-journal-flush.service | + | |
- | 697ms nfs-common.service | + | |
- | 644ms systemd-tmpfiles-setup-dev.service | + | |
- | 600ms console-setup.service | + | |
- | 555ms rpcbind.service | + | |
- | 494ms systemd-setup-dgram-qlen.service | + | |
- | 456ms sys-kernel-debug.mount | + | |
- | lines 1-31 | + | |
- | </ | + | |
- | L'option **critical-chain** permet de voir l' | + | # this won't be correct after changing uid |
+ | unset HOME | ||
- | < | + | # for supporting multiple apache2 instances |
- | root@debian8: | + | if [ " |
- | The time after the unit is active or started is printed after the "@" | + | |
- | The time the unit takes to start is printed after the "+" | + | else |
+ | SUFFIX= | ||
+ | fi | ||
- | ssh.service @10.074s | + | # Since there is no sane way to get the parsed apache2 config in scripts, some |
- | └─basic.target @9.951s | + | # settings are defined via environment variables and then used in apache2ctl, |
- | | + | # /etc/init.d/apache2, / |
- | └─cups.path @9.950s | + | export APACHE_RUN_USER=www-data |
- | | + | export APACHE_RUN_GROUP=www-data |
- | └─nfs-common.service @9.242s +697ms | + | # temporary state file location. This might be changed to /run in Wheezy+1 |
- | └─rpcbind.target @9.242s | + | export APACHE_PID_FILE=/ |
- | └─rpcbind.service @8.684s +555ms | + | export APACHE_RUN_DIR=/ |
- | | + | export APACHE_LOCK_DIR=/ |
- | | + | # Only / |
- | └─networking.service @5.788s +2.895s | + | export APACHE_LOG_DIR=/ |
- | └─systemd-random-seed.service @5.458s +328ms | + | |
- | └─systemd-remount-fs.service @5.298s +157ms | + | |
- | └─keyboard-setup.service @3.837s | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | </code> | + | ## The locale used by some modules like mod_dav |
+ | export LANG=C | ||
+ | ## Uncomment the following line to use the system default locale instead: | ||
+ | #. /etc/ | ||
- | ===Options de la Commande=== | + | export LANG |
- | Les options de la commande | + | ## The command to get the status for ' |
+ | ## Some packages providing ' | ||
+ | #export APACHE_LYNX=' | ||
+ | |||
+ | ## If you need a higher file descriptor limit, uncomment and adjust the | ||
+ | ## following line (default is 8192): | ||
+ | # | ||
+ | |||
+ | ## If you would like to pass arguments to the web server, add them below | ||
+ | ## to the APACHE_ARGUMENTS environment. | ||
+ | #export APACHE_ARGUMENTS='' | ||
+ | |||
+ | ## Enable the debug mode for maintainer scripts. | ||
+ | ## This will produce a verbose output on package installations of web server modules and web application | ||
+ | ## installations which interact with Apache | ||
+ | #export APACHE2_MAINTSCRIPT_DEBUG=1 | ||
+ | </ | ||
+ | |||
+ | Editez | ||
< | < | ||
- | root@debian8:~# systemd-analyze | + | root@debian11:~# vi / |
- | systemd-analyze [OPTIONS...] {COMMAND} ... | + | root@debian11: |
+ | # envvars | ||
- | Process systemd profiling information. | + | # this won't be correct after changing uid |
+ | unset HOME | ||
- | -h --help | + | # for supporting multiple apache2 instances |
- | | + | if [ " |
- | | + | |
- | | + | else |
- | | + | |
- | -H --host=[USER@]HOST | + | fi |
- | -M --machine=CONTAINER | + | |
- | --order When generating a dependency graph, show only order | + | |
- | --require | + | |
- | --from-pattern=GLOB, --to-pattern=GLOB | + | |
- | When generating a dependency graph, filter only origins | + | |
- | or destinations, | + | |
- | | + | |
- | services, which finished TIMESPAN earlier, than the | + | |
- | latest in the branch. The unit of TIMESPAN is seconds | + | |
- | | + | |
- | Commands: | + | # Since there is no sane way to get the parsed apache2 config in scripts, some |
- | | + | # settings are defined via environment variables and then used in apache2ctl, |
- | | + | # /etc/init.d/apache2, / |
- | | + | export APACHE_RUN_USER=www-data |
- | | + | export APACHE_RUN_GROUP=www-data |
- | | + | # temporary state file location. This might be changed to /run in Wheezy+1 |
- | set-log-level LEVEL Set logging threshold for systemd | + | export APACHE_PID_FILE=/ |
- | | + | export APACHE_RUN_DIR=/ |
- | </code> | + | export APACHE_LOCK_DIR=/ |
+ | # Only / | ||
+ | export APACHE_LOG_DIR=/ | ||
- | ====Gestion des Services==== | + | ## The locale used by some modules like mod_dav |
+ | export LANG=C | ||
+ | ## Uncomment the following line to use the system default locale instead: | ||
+ | #. / | ||
- | Sous Debian 8, sshd.service est un lien vers ssh.service : | + | export LANG |
- | < | + | ## The command to get the status for ' |
- | root@debian8: | + | ## Some packages providing ' |
- | lrwxrwxrwx 1 root root 31 Oct 23 16:34 / | + | #export APACHE_LYNX=' |
- | </ | + | |
+ | ## If you need a higher file descriptor limit, uncomment and adjust the | ||
+ | ## following line (default is 8192): | ||
+ | # | ||
+ | |||
+ | ## If you would like to pass arguments to the web server, add them below | ||
+ | ## to the APACHE_ARGUMENTS environment. | ||
+ | #export APACHE_ARGUMENTS='' | ||
+ | |||
+ | ## Enable the debug mode for maintainer scripts. | ||
+ | ## This will produce a verbose output on package installations of web server modules and web application | ||
+ | ## installations which interact with Apache | ||
+ | #export APACHE2_MAINTSCRIPT_DEBUG=1 | ||
+ | </ | ||
- | Pour obtenir le détail sur un service donné, il convient d' | + | Créez les répertoires |
< | < | ||
- | root@debian8:~# systemctl status ssh.service | + | root@debian11:~# mkdir /var/log/apache2-instance01 |
- | ● ssh.service - OpenBSD Secure Shell server | + | root@debian11:~# mkdir /var/log/apache2-instance02 |
- | | + | |
- | | + | |
- | Main PID: 2024 (sshd) | + | |
- | | + | |
- | | + | |
- | Nov 01 09:35:03 debian8 sshd[2024]: Server listening on 0.0.0.0 port 22. | + | root@debian11:~# chown root:adm / |
- | Nov 01 09:35:03 debian8 sshd[2024]: Server listening on :: port 22. | + | root@debian11:~# chown root:adm / |
</ | </ | ||
- | Pour arrêter une Unité de service, utilisez la commande suivante | + | Démarrez les deux services |
< | < | ||
- | root@debian8:~# systemctl | + | root@debian11:~# systemctl |
- | root@debian8:~# systemctl status ssh.service | + | |
- | ● ssh.service - OpenBSD Secure Shell server | + | |
- | | + | |
- | | + | |
- | Main PID: 2024 (code=exited, | + | |
- | Nov 01 09:35:03 debian8 sshd[2024]: Server | + | root@debian11:~# systemctl status apache2@instance01.service |
- | Nov 01 09:35:03 debian8 sshd[2024]: Server | + | ● apache2@instance01.service - The Apache HTTP Server |
+ | | ||
+ | | ||
+ | Docs: https:// | ||
+ | Process: 56906 ExecStart=/ | ||
+ | Main PID: 56910 (apache2) | ||
+ | Tasks: 55 (limit: 4663) | ||
+ | | ||
+ | CPU: 31ms | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Apr 30 13:51:47 debian11 systemd[1]: Starting The Apache HTTP Server... | ||
+ | Apr 30 13:51:47 debian11 systemd[1]: Started The Apache HTTP Server. | ||
+ | |||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | ● apache2@instance02.service - The Apache HTTP Server | ||
+ | | ||
+ | | ||
+ | Docs: https:// | ||
+ | Process: 57137 ExecStart=/ | ||
+ | Main PID: 57148 (apache2) | ||
+ | Tasks: 55 (limit: 4663) | ||
+ | | ||
+ | CPU: 37ms | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Apr 30 14:04:21 debian11 systemd[1]: Starting The Apache HTTP Server... | ||
+ | Apr 30 14:04:21 debian11 systemd[1]: Started The Apache HTTP Server. | ||
</ | </ | ||
- | Pour démarrer un service, utilisez la commande suivante | + | Installez l' |
< | < | ||
- | root@debian8:~# systemctl start ssh.service | + | root@debian11:~# apt -y install lynx |
- | root@debian8: | + | |
- | ● ssh.service | + | |
- | | + | |
- | | + | |
- | Main PID: 2180 (sshd) | + | |
- | | + | |
- | | + | |
- | + | ||
- | Nov 01 09:47:10 debian8 sshd[2180]: Server listening on 0.0.0.0 port 22. | + | |
- | Nov 01 09:47:10 debian8 sshd[2180]: Server listening on :: port 22. | + | |
</ | </ | ||
- | Pour désactiver un service au prochain démarrage du système, utilisez l'option **disable** | + | Testez ensuite les deux instances d'Apache |
< | < | ||
- | root@debian8:~# systemctl disable ssh.service | + | root@debian11:~# lynx --dump http://localhost:81 | more |
- | Synchronizing state for ssh.service with sysvinit using update-rc.d... | + | Debian Logo Apache2 Debian Default Page |
- | Executing / | + | It works! |
- | Executing / | + | |
- | insserv: warning: current start runlevel(s) (empty) of script `ssh' overrides LSB defaults (2 3 4 5). | + | |
- | insserv: warning: current stop runlevel(s) (2 3 4 5) of script `ssh' overrides LSB defaults (empty). | + | |
- | Removed symlink | + | |
- | root@debian8:~# systemctl status ssh.service | + | |
- | ● ssh.service - OpenBSD Secure Shell server | + | |
- | Loaded: loaded (/ | + | |
- | Active: active (running) since Sun 2015-11-01 09:47:10 CET; 1min 7s ago | + | |
- | Main PID: 2180 (sshd) | + | |
- | | + | |
- | | + | |
- | Nov 01 09:47:10 debian8 sshd[2180]: Server | + | This is the default welcome page used to test the correct operation of |
- | Nov 01 09:47:10 debian8 sshd[2180]: Server listening | + | the Apache2 server after installation on Debian systems. If you can |
+ | read this page, it means that the Apache HTTP server installed at this | ||
+ | site is working properly. You should replace this file (located at | ||
+ | / | ||
+ | | ||
+ | |||
+ | If you are a normal user of this web site and don't know what this page | ||
+ | is about, this probably means that the site is currently unavailable | ||
+ | due to maintenance. If the problem persists, please contact the site' | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | for the full documentation. Documentation for the web server itself can | ||
+ | be found by accessing the [1]manual if the apache2-doc package was | ||
+ | | ||
+ | |||
+ | The configuration layout for an Apache2 web server installation on | ||
+ | | ||
+ | / | ||
+ | |-- apache2.conf | ||
+ | | | ||
+ | |-- mods-enabled | ||
+ | | |-- *.load | ||
+ | | `-- *.conf | ||
+ | |-- conf-enabled | ||
+ | | `-- *.conf | ||
+ | |-- sites-enabled | ||
+ | | `-- *.conf | ||
+ | |||
+ | * apache2.conf is the main configuration file. It puts the pieces | ||
+ | | ||
+ | | ||
+ | * ports.conf is always included from the main configuration file. It | ||
+ | is used to determine the listening | ||
+ | and this file can be customized anytime. | ||
+ | * Configuration files in the mods-enabled/, | ||
+ | | ||
+ | | ||
+ | | ||
+ | * They are activated by symlinking available configuration files from | ||
+ | their respective *-available/ | ||
+ | by using our helpers a2enmod, a2dismod, a2ensite, a2dissite, and | ||
+ | | ||
+ | information. | ||
+ | * The binary is called apache2. Due to the use of environment | ||
+ | | ||
+ | | ||
+ | / | ||
+ | | ||
+ | |||
+ | --More-- | ||
+ | [q] | ||
+ | |||
+ | root@debian11:~# lynx --dump http:// | ||
+ | | ||
+ | It works! | ||
+ | |||
+ | This is the default welcome page used to test the correct operation of | ||
+ | the Apache2 server after installation on Debian systems. If you can | ||
+ | read this page, it means that the Apache HTTP server installed at this | ||
+ | site is working properly. You should replace this file (located at | ||
+ | / | ||
+ | | ||
+ | |||
+ | If you are a normal user of this web site and don't know what this page | ||
+ | is about, this probably means that the site is currently unavailable | ||
+ | due to maintenance. If the problem persists, please contact the site' | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | for the full documentation. Documentation for the web server itself can | ||
+ | be found by accessing the [1]manual if the apache2-doc package was | ||
+ | | ||
+ | |||
+ | The configuration layout for an Apache2 web server installation on | ||
+ | | ||
+ | / | ||
+ | |-- apache2.conf | ||
+ | | | ||
+ | |-- mods-enabled | ||
+ | | |-- *.load | ||
+ | | `-- *.conf | ||
+ | |-- conf-enabled | ||
+ | | `-- *.conf | ||
+ | |-- sites-enabled | ||
+ | | `-- *.conf | ||
+ | |||
+ | * apache2.conf is the main configuration file. It puts the pieces | ||
+ | | ||
+ | | ||
+ | * ports.conf is always included from the main configuration file. It | ||
+ | is used to determine the listening ports for incoming connections, | ||
+ | and this file can be customized anytime. | ||
+ | * Configuration files in the mods-enabled/, | ||
+ | | ||
+ | | ||
+ | | ||
+ | * They are activated by symlinking available configuration files from | ||
+ | their respective *-available/ | ||
+ | by using our helpers a2enmod, a2dismod, a2ensite, a2dissite, and | ||
+ | | ||
+ | | ||
+ | * The binary is called apache2. Due to the use of environment | ||
+ | | ||
+ | | ||
+ | / | ||
+ | | ||
+ | |||
+ | --More-- | ||
+ | [q] | ||
</ | </ | ||
- | Pour activer un service au prochain démarrage | + | ===6.3 - Interdire la Modification |
+ | |||
+ | Il est possible d'interdire la modification en utilisant la commande | ||
< | < | ||
- | root@debian8:~# systemctl | + | root@debian11:~# systemctl |
- | Synchronizing state for ssh.service with sysvinit using update-rc.d... | + | ● apache2.service - The Apache HTTP Server |
- | Executing | + | |
- | insserv: warning: current | + | |
- | insserv: warning: current stop runlevel(s) (2 3 4 5) of script | + | Docs: https:// |
- | Executing /usr/sbin/update-rc.d ssh enable | + | Main PID: 56452 (apache2) |
- | Created symlink from /etc/ | + | Tasks: 55 (limit: 4663) |
- | root@debian8:~# systemctl status | + | |
- | ● ssh.service - OpenBSD Secure Shell server | + | CPU: 379ms |
- | | + | |
- | | + | |
- | Main PID: 2180 (sshd) | + | |
- | | + | |
- | | + | |
+ | Apr 30 12:30:17 debian11 systemd[1]: Starting The Apache HTTP Server... | ||
+ | Apr 30 12:30:17 debian11 systemd[1]: Started The Apache HTTP Server. | ||
+ | |||
+ | root@debian11: | ||
+ | Created symlink / | ||
+ | |||
+ | root@debian11: | ||
+ | apache2.service | ||
+ | apache2@.service | ||
+ | apache2@instance01.service | ||
+ | apache2@instance02.service | ||
+ | |||
+ | root@debian11: | ||
+ | Synchronizing state of apache2.service with SysV service script with / | ||
+ | Executing: / | ||
+ | Unit / | ||
+ | |||
+ | root@debian11: | ||
+ | ● apache2.service - The Apache HTTP Server | ||
+ | | ||
+ | | ||
+ | Docs: https:// | ||
+ | Process: 57431 ExecStart=/usr/sbin/apachectl start (code=exited, | ||
+ | Main PID: 57435 (apache2) | ||
+ | Tasks: 55 (limit: 4663) | ||
+ | | ||
+ | CPU: 33ms | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Apr 30 14:17:14 debian11 systemd[1]: Starting The Apache HTTP Server... | ||
+ | Apr 30 14:17:14 debian11 systemd[1]: Started The Apache HTTP Server. | ||
+ | |||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | ● apache2.service | ||
+ | | ||
+ | | ||
+ | Main PID: 57435 (code=exited, | ||
+ | CPU: 39ms | ||
+ | |||
+ | Apr 30 14:17:14 debian11 systemd[1]: Starting The Apache HTTP Server... | ||
+ | Apr 30 14:17:14 debian11 systemd[1]: Started The Apache HTTP Server. | ||
+ | Apr 30 14:17:45 debian11 systemd[1]: Stopping apache2.service... | ||
+ | Apr 30 14:17:45 debian11 systemd[1]: apache2.service: | ||
+ | Apr 30 14:17:45 debian11 systemd[1]: Stopped apache2.service. | ||
+ | |||
+ | root@debian11: | ||
+ | Failed to start apache2.service: | ||
+ | |||
+ | root@debian11: | ||
+ | Removed / | ||
+ | |||
+ | root@debian11: | ||
+ | ● apache2.service - The Apache HTTP Server | ||
+ | | ||
+ | | ||
+ | Docs: https:// | ||
+ | Main PID: 57435 (code=exited, | ||
+ | CPU: 39ms | ||
+ | |||
+ | Apr 30 14:17:14 debian11 systemd[1]: Starting The Apache HTTP Server... | ||
+ | Apr 30 14:17:14 debian11 systemd[1]: Started The Apache HTTP Server. | ||
+ | Apr 30 14:17:45 debian11 systemd[1]: Stopping apache2.service... | ||
+ | Apr 30 14:17:45 debian11 systemd[1]: apache2.service: | ||
+ | Apr 30 14:17:45 debian11 systemd[1]: Stopped apache2.service. | ||
+ | |||
+ | root@debian11: | ||
+ | Synchronizing state of apache2.service with SysV service | ||
+ | Executing: /lib/systemd/systemd-sysv-install | ||
+ | |||
+ | root@debian11: | ||
+ | ● apache2.service - The Apache HTTP Server | ||
+ | | ||
+ | | ||
+ | Docs: https://httpd.apache.org/docs/2.4/ | ||
+ | Main PID: 57435 (code=exited, | ||
+ | CPU: 39ms | ||
+ | |||
+ | Apr 30 14:17:14 debian11 systemd[1]: Starting The Apache HTTP Server... | ||
+ | Apr 30 14:17:14 debian11 systemd[1]: Started The Apache HTTP Server. | ||
+ | Apr 30 14:17:45 debian11 systemd[1]: Stopping apache2.service... | ||
+ | Apr 30 14:17:45 debian11 systemd[1]: apache2.service: | ||
+ | Apr 30 14:17:45 debian11 systemd[1]: Stopped apache2.service. | ||
+ | |||
+ | root@debian11: | ||
+ | |||
+ | root@debian11:~# systemctl status | ||
+ | ● apache2.service - The Apache HTTP Server | ||
+ | | ||
+ | | ||
+ | Docs: https:// | ||
+ | Process: 57685 ExecStart=/ | ||
+ | Main PID: 57689 (apache2) | ||
+ | | ||
+ | | ||
+ | CPU: 30ms | ||
+ | CGroup: / | ||
+ | ├─57689 / | ||
+ | | ||
+ | └─57691 /usr/sbin/apache2 | ||
- | Nov 01 09:47:10 debian8 sshd[2180]: Server | + | Apr 30 14:19:11 debian11 systemd[1]: Starting The Apache HTTP Server... |
- | Nov 01 09:47:10 debian8 sshd[2180]: Server | + | Apr 30 14:19:12 debian11 systemd[1]: Started The Apache HTTP Server. |
</ | </ | ||
Ligne 2202: | Ligne 2697: | ||
< | < | ||
- | root@debian8:~# shutdown --help | + | root@debian11:~# shutdown --help |
shutdown [OPTIONS...] [TIME] [WALL...] | shutdown [OPTIONS...] [TIME] [WALL...] | ||
Shut down the system. | Shut down the system. | ||
+ | Options: | ||
| | ||
-H --halt | -H --halt | ||
Ligne 2215: | Ligne 2711: | ||
| | ||
-c | -c | ||
+ | |||
+ | See the shutdown(8) man page for details. | ||
</ | </ | ||
Ligne 2236: | Ligne 2734: | ||
**Important** : Si l' | **Important** : Si l' | ||
</ | </ | ||
- | |||
- | Dans votre VM, ouvrez deux terminaux. Dans le premier passez en tant que root. Planifiez ensuite un redémarrage de la VM dans 30 minutes : | ||
- | |||
- | < | ||
- | root@debian8: | ||
- | Shutdown scheduled for Sun 2015-11-01 10:21:04 CET, use ' | ||
- | </ | ||
- | |||
- | Dans le deuxième terminal est passez en tant que route. Annulez ensuite le shutdown : | ||
- | |||
- | < | ||
- | trainee@debian8: | ||
- | Password: | ||
- | root@debian8: | ||
- | |||
- | Broadcast message from root@debian8 (Sun 2015-11-01 09:53:34 CET): | ||
- | |||
- | The system shutdown has been cancelled at Sun 2015-11-01 09:54:34 CET! | ||
- | |||
- | root@debian8: | ||
- | </ | ||
- | |||
- | Retournez au premier terminal et constatez le message affiché : | ||
- | |||
- | < | ||
- | root@debian8: | ||
- | Broadcast message from root@debian8 (Sun 2015-11-01 09:53:34 CET): | ||
- | |||
- | The system shutdown has been cancelled at Sun 2015-11-01 09:54:34 CET! | ||
- | |||
- | |||
- | </ | ||
==== La commande reboot==== | ==== La commande reboot==== | ||
Ligne 2278: | Ligne 2744: | ||
< | < | ||
- | root@debian8:~# reboot --help | + | root@debian11:~# reboot --help |
reboot [OPTIONS...] [ARG] | reboot [OPTIONS...] [ARG] | ||
Reboot the system. | Reboot the system. | ||
+ | Options: | ||
| | ||
| | ||
Ligne 2291: | Ligne 2758: | ||
-d --no-wtmp | -d --no-wtmp | ||
| | ||
+ | |||
+ | See the halt(8) man page for details. | ||
</ | </ | ||
Ligne 2302: | Ligne 2771: | ||
< | < | ||
- | root@debian8:~# halt --help | + | root@debian11:~# halt --help |
halt [OPTIONS...] | halt [OPTIONS...] | ||
Halt the system. | Halt the system. | ||
+ | Options: | ||
| | ||
| | ||
Ligne 2315: | Ligne 2785: | ||
-d --no-wtmp | -d --no-wtmp | ||
| | ||
+ | |||
+ | See the halt(8) man page for details. | ||
</ | </ | ||
Ligne 2326: | Ligne 2798: | ||
< | < | ||
- | root@debian8:~# poweroff --help | + | root@debian11:~# poweroff --help |
poweroff [OPTIONS...] | poweroff [OPTIONS...] | ||
Power off the system. | Power off the system. | ||
+ | Options: | ||
| | ||
| | ||
Ligne 2339: | Ligne 2812: | ||
-d --no-wtmp | -d --no-wtmp | ||
| | ||
+ | |||
+ | See the halt(8) man page for details. | ||
</ | </ | ||
- | ----- | + | <WRAP center |
- | < | + | **Important** : Avant de poursuivre, supprimez le fichier **/etc/ |
- | <div align=" | + | </WRAP> |
- | Copyright © 2020 Hugh Norris | + | |
- | </div> | + | |
- | </html> | + | |
- | ----- | + | |
+ | ----- | ||
+ | Copyright © 2024 Hugh Norris. |