Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| elearning:workbooks:redhat:rh124:l110 [2024/09/25 08:04] – created admin | elearning:workbooks:redhat:rh124:l110 [2024/11/28 08:58] (Version actuelle) – admin | ||
|---|---|---|---|
| Ligne 5: | Ligne 5: | ||
| Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
| - | ======LCF510 | + | ======RH12411 |
| =====Contenu du Module===== | =====Contenu du Module===== | ||
| - | * **LCF510 | + | * **RH12411 |
| - | * Contenu du Module | + | |
| * Présentation | * Présentation | ||
| - | * BIOS, EFI et OpenFirmware | + | * La Commande dmesg |
| - | * Systèmes à base du BIOS | + | * LAB #1 - Surveillance Sécuritaire |
| - | * Charger de Démarrage | + | * 1.1 - La Commande last |
| - | * Systèmes à base de l'EFI | + | * 1.2 - La Commande lastlog |
| - | * Autres Systèmes | + | * 1.3 - La Commande lastb |
| - | * Gestionnaire d' | + | * 1.4 - Le Fichier / |
| - | * GRUB 2 | + | * 1.5 - Gestion des évènements audit |
| - | * Le fichier /boot/grub/device.map | + | * Le fichier /var/log/audit/audit.log |
| - | * Le fichier /etc/default/grub | + | |
| - | * Les fichiers du répertoire /etc/grub.d | + | * auditctl |
| - | * Configurer l' | + | * audispd |
| - | * Modifier la Configuration de GRUB 2 en Ligne de Commande | + | * La consultation des événements audit |
| - | * Chargeurs de Démarrages Alternatifs | + | * La Commande aureport |
| - | * Systemd-boot | + | * La Commande ausearch |
| - | * U-boot | + | |
| - | * Le Projet Syslinux | + | * Applications |
| - | * SYSLINUX | + | * LAB #2 - rsyslog |
| - | * EXTLINUX | + | * 2.1 - Priorités |
| - | * ISOLINUX | + | * 2.2 - Sous-systèmes applicatifs |
| - | * PXELINUX | + | * 2.3 - / |
| - | * Isodhpfx | + | * Modules |
| - | * Initramfs | + | * Directives Globales |
| - | * Examiner l'image existante | + | * Règles |
| - | | + | * Sous-système applicatif.Priorité |
| - | * Consulter le contenu d'un fichier dans initramfs | + | * Sous-système applicatif!Priorité |
| - | * Processus de Démarrage du Noyau Linux | + | * Sous-système applicatif=Priorité |
| - | * Processus Init | + | * L'utilisation du caractère spécial |
| - | | + | * n Sous-systèmes avec la même priorité |
| - | | + | * n Sélecteurs avec la même Action |
| - | * LAB #2 - Fichiers de Configuration | + | * LAB #3 - La Commande logger |
| - | * 2.1 - Fichiers de Configuration par Défaut | + | * LAB #4 - La Commande |
| - | * 2.2 - Surchargement | + | * LAB #5 - La Journalisation avec journald |
| - | * LAB #3 - La Commande systemd-analyze | + | * 5.1 - Consultation des Journaux |
| - | * LAB #4 - Les Cibles Systemd | + | * 5.2 - Consultation |
| - | * 4.1 - Contrôler les dépendances | + | * 5.3 - Consultation des Journaux depuis le Dernier Démarrage |
| - | * 4.2 - La Cible par Défaut | + | * 5.4 - Consultation des Journaux d'une Priorité Spécifique |
| - | * LAB #5 - Gestion | + | * 5.5 - Consultation des Journaux |
| - | * 5.1 - Gestion | + | * 5.6 - Consultation |
| - | * 5.2 - Gestion | + | * 5.7 - Consultation |
| - | * 5.3 - Interdire la Modification du Statut d'un Service | + | * LAB #6 - Le Serveur |
| - | * Arrêt Système du Système | + | * 6.1 - Introduction |
| - | * La Commande shutdown | + | * 6.2 - Le Service chronyd |
| - | * La Commande reboot | + | * 6.2 - Le Fichier / |
| - | * La Commande halt | + | |
| - | * La Commande poweroff | + | |
| =====Présentation===== | =====Présentation===== | ||
| - | Le processus de démarrage de Linux peut être résumé en trois étapes majeurs : | + | La majorité des journaux du système et des applications se trouve dans le répertoire **/ |
| - | * Le **firmware** ou **micrologiciel** démarre en effectuant un test rapide du matériel, appelé un **Power-On Self Test** ou **POST**, puis recherche le **Charger de Démarrage** (// | + | <WRAP center round important |
| - | * Le Charger de Démarrage est exécuté et il détermine quel noyau Linux à charger, | + | **Important** : Il est conseillé |
| - | * Le noyau se charge en mémoire et commence à exécuter en arrière plan les programmes nécessaires au fonctionnement du système. | + | |
| - | + | ||
| - | <WRAP center round tip 60%> | + | |
| - | **A retenir** : Il est possible | + | |
| </ | </ | ||
| - | Cette description simpliste résume cependant un processus bien plus compliqué que ce cours va détailler. | + | =====La Commande / |
| - | =====BIOS, EFI et OpenFirmware===== | + | Cette commande retourne les messages du noyau (**//Kernel Ring Buffer//**) stockés dans le fichier **/ |
| - | ====Systèmes à base du BIOS==== | + | < |
| + | [root@redhat9 ~]# dmesg | more | ||
| + | [ 0.000000] Linux version 5.14.0-427.37.1.el9_4.x86_64 (mockbuild@x86-64-02.build.eng.rdu2.redhat.com) (gcc (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3), GNU ld version 2.35.2-43.el9) #1 SMP PREEMPT_DYNAMIC Fri | ||
| + | Sep 13 12:41:50 EDT 2024 | ||
| + | [ 0.000000] The list of certified hardware and cloud instances for Red Hat Enterprise Linux 9 can be viewed at the Red Hat Ecosystem Catalog, https:// | ||
| + | [ 0.000000] Command line: BOOT_IMAGE=(hd0, | ||
| + | oot rd.lvm.lv=rhel/ | ||
| + | [ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' | ||
| + | [ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' | ||
| + | [ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' | ||
| + | [ 0.000000] x86/fpu: xstate_offset[2]: | ||
| + | [ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using ' | ||
| + | [ 0.000000] signal: max sigframe size: 1776 | ||
| + | [ 0.000000] | ||
| + | [ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable | ||
| + | [ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved | ||
| + | [ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved | ||
| + | [ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000bffd9fff] usable | ||
| + | [ 0.000000] BIOS-e820: [mem 0x00000000bffda000-0x00000000bfffffff] reserved | ||
| + | [ 0.000000] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved | ||
| + | [ 0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved | ||
| + | [ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000023fffffff] usable | ||
| + | [ 0.000000] NX (Execute Disable) protection: active | ||
| + | [ 0.000000] SMBIOS 2.8 present. | ||
| + | [ 0.000000] DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/ | ||
| + | [ 0.000000] Hypervisor detected: KVM | ||
| + | [ 0.000000] kvm-clock: Using msrs 4b564d01 and 4b564d00 | ||
| + | [ 0.000001] kvm-clock: using sched offset of 11342917026 cycles | ||
| + | [ 0.000003] clocksource: | ||
| + | [ 0.000010] tsc: Detected 2099.998 MHz processor | ||
| + | [ 0.001013] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved | ||
| + | [ 0.001016] e820: remove [mem 0x000a0000-0x000fffff] usable | ||
| + | [ 0.001021] last_pfn | ||
| + | [ 0.001058] MTRR map: 4 entries (3 fixed + 1 variable; max 19), built from 8 variable MTRRs | ||
| + | [ 0.001061] x86/PAT: Configuration [0-7]: WB WC UC- UC WB WP UC- WT | ||
| + | [ 0.001103] last_pfn | ||
| + | [ 0.009594] found SMP MP-table at [mem 0x000f5bc0-0x000f5bcf] | ||
| + | [ 0.009621] Using GB pages for direct mapping | ||
| + | [ 0.009825] RAMDISK: [mem 0x3149c000-0x34a45fff] | ||
| + | [ 0.009836] ACPI: Early table checksum verification disabled | ||
| + | [ 0.009849] ACPI: RSDP 0x00000000000F5980 000014 (v00 BOCHS ) | ||
| + | [ 0.009857] ACPI: RSDT 0x00000000BFFE300C 000038 (v01 BOCHS BXPC | ||
| + | [ 0.009870] ACPI: FACP 0x00000000BFFE2DDE 000074 (v01 BOCHS BXPC | ||
| + | [ 0.009876] ACPI: DSDT 0x00000000BFFDF040 003D9E (v01 BOCHS BXPC | ||
| + | [ 0.009881] ACPI: FACS 0x00000000BFFDF000 000040 | ||
| + | [ 0.009885] ACPI: APIC 0x00000000BFFE2E52 000090 (v01 BOCHS BXPC | ||
| + | [ 0.009889] ACPI: SSDT 0x00000000BFFE2EE2 0000CA (v01 BOCHS VMGENID | ||
| + | [ 0.009893] ACPI: HPET 0x00000000BFFE2FAC 000038 (v01 BOCHS BXPC | ||
| + | [ 0.009898] ACPI: WAET 0x00000000BFFE2FE4 000028 (v01 BOCHS BXPC | ||
| + | [ 0.009901] ACPI: Reserving FACP table memory at [mem 0xbffe2dde-0xbffe2e51] | ||
| + | [ 0.009902] ACPI: Reserving DSDT table memory at [mem 0xbffdf040-0xbffe2ddd] | ||
| + | [ 0.009903] ACPI: Reserving FACS table memory at [mem 0xbffdf000-0xbffdf03f] | ||
| + | [ 0.009904] ACPI: Reserving APIC table memory at [mem 0xbffe2e52-0xbffe2ee1] | ||
| + | [ 0.009905] ACPI: Reserving SSDT table memory at [mem 0xbffe2ee2-0xbffe2fab] | ||
| + | [ 0.009906] ACPI: Reserving HPET table memory at [mem 0xbffe2fac-0xbffe2fe3] | ||
| + | [ 0.009906] ACPI: Reserving WAET table memory at [mem 0xbffe2fe4-0xbffe300b] | ||
| + | [ 0.010241] No NUMA configuration found | ||
| + | --More-- | ||
| + | [q] | ||
| + | </ | ||
| - | Au démarrage d'un système à base d'un processeur x86 ou x86-64, le premier programme exécuté a été traditionnellement le BIOS. Le BIOS a pour fonction | + | Les option |
| - | * Tester les composants et les circuits, | + | < |
| - | * Faire appel au BIOS de la carte graphique pour initialiser le système d' | + | [root@redhat9 ~]# dmesg --help |
| - | * Détecter les périphériques de stockage, | + | |
| - | * Lancer le **Charger de Démarrage** du système d' | + | |
| - | ===Chargeur de Démarrage=== | + | Usage: |
| + | dmesg [options] | ||
| - | La première partie du Chargeur de Démarrage est en règle générale placé dans le MBR du disque. Le format du MBR est le suivant : | + | Display or control the kernel ring buffer. |
| - | * 446 octets pour le Charger de Démarrage, | + | Options: |
| - | * 64 octets pour la table de partitions, soit 16 octets par partition décrite, | + | -C, --clear |
| - | | + | -c, --read-clear |
| + | -D, --console-off | ||
| + | -E, --console-on | ||
| + | -F, --file < | ||
| + | -f, --facility < | ||
| + | -H, --human | ||
| + | -k, --kernel | ||
| + | -L, --color[=< | ||
| + | | ||
| + | -l, --level < | ||
| + | -n, --console-level < | ||
| + | -P, --nopager | ||
| + | -p, --force-prefix | ||
| + | -r, --raw print the raw message buffer | ||
| + | | ||
| + | -S, --syslog | ||
| + | -s, --buffer-size < | ||
| + | -u, --userspace | ||
| + | -w, --follow | ||
| + | -W, --follow-new | ||
| + | -x, --decode | ||
| + | -d, --show-delta | ||
| + | -e, --reltime | ||
| + | -T, --ctime | ||
| + | -t, --notime | ||
| + | | ||
| + | | ||
| + | Suspending/ | ||
| + | | ||
| + | | ||
| - | ====Systèmes à base de l' | + | -h, --help |
| + | -V, --version | ||
| - | Depuis 2011, le BIOS est en train d' | + | Supported log facilities: |
| + | kern - kernel messages | ||
| + | user - random user-level messages | ||
| + | mail - mail system | ||
| + | daemon - system daemons | ||
| + | auth - security/authorization messages | ||
| + | syslog - messages generated internally by syslogd | ||
| + | lpr - line printer subsystem | ||
| + | news - network news subsystem | ||
| - | Sous EFI la première partie du gestionnaire de démarrage est un fichier ayant une extension .efi se trouvant dans un sous-répertoire au nom du système d' | + | Supported log levels (priorities): |
| + | | ||
| + | alert - action must be taken immediately | ||
| + | crit - critical conditions | ||
| + | err - error conditions | ||
| + | warn - warning conditions | ||
| + | notice - normal but significant condition | ||
| + | info - informational | ||
| + | debug - debug-level messages | ||
| - | Pour que EFI fonctionne, le micrologiciel | + | For more details see dmesg(1). |
| + | </ | ||
| - | <WRAP center round tip 60%> | + | =====LAB #1 - Surveillance Sécuritaire===== |
| - | **A retenir** : Sous Linux c'est l' | + | |
| - | </ | + | |
| - | <WRAP center round important 60%> | + | ====1.1 |
| - | **Important** : L'UEFI gère les **SSD** (//Solid State Drives//) qui utilisent le standard **NVMe** (//Non-Volatile Memory Express//). Linux supporte les SSD depuis le noyau 3.3. | + | |
| - | </ | + | |
| - | ====Autres Systèmes==== | + | Cette commande indique les dates et heures des connexions des utilisateurs à partir du contenu du fichier **/ |
| - | Les systèmes utilisant des processeurs autre qu'un x86 ou x86-64 utilisent un logiciel tel **[[http://fr.wikipedia.org/wiki/Open_Firmware|OpenFirmware]]**. | + | < |
| + | [root@redhat9 ~]# last | ||
| + | trainee | ||
| + | trainee | ||
| + | trainee | ||
| + | trainee | ||
| + | trainee | ||
| + | trainee | ||
| + | reboot | ||
| + | reboot | ||
| + | trainee | ||
| + | trainee | ||
| + | reboot | ||
| + | trainee | ||
| + | trainee | ||
| + | trainee | ||
| + | reboot | ||
| - | =====Gestionnaires de Démarrage===== | + | wtmp begins Thu Oct 19 18:27:17 2023 |
| + | </ | ||
| - | ====GRUB 2==== | + | Les option de cette commande sont : |
| - | GRUB 2 est une ré-écriture complète de GRUB Legacy. Il apporte des améliorations, | + | < |
| + | [root@redhat9 ~]# last --help | ||
| - | Le lancement de GRUB 2 se fait en trois étapes | + | Usage: |
| + | last [options] [< | ||
| - | * Etape 1 : Le **boot.img**, | + | Show a listing of last logged in users. |
| - | * Etape 1.5 : Le **core.img**, | + | |
| - | * Etape 2 : Contenu dans le répertoire **/ | + | |
| - | Dans le cas où le Charger de Démarrage **GRUB 2** n'est pas installé, il convient de saisir la commande suivante | + | Options: |
| + | | ||
| + | -a, --hostlast | ||
| + | -d, --dns translate the IP number back into a hostname | ||
| + | -f, --file < | ||
| + | -F, --fulltimes | ||
| + | -i, --ip | ||
| + | -n, --limit < | ||
| + | -R, --nohostname | ||
| + | -s, --since < | ||
| + | -t, --until < | ||
| + | -p, --present < | ||
| + | -w, --fullnames | ||
| + | -x, --system | ||
| + | | ||
| + | | ||
| - | # grub2-install / | + | -h, --help |
| + | -V, --version | ||
| - | où **périphérique** est le nom du périphérique ou l' | + | For more details see last(1). |
| + | </ | ||
| - | **GRUB | + | ====1.2 - La Commande lastlog==== |
| + | |||
| + | Cette commande indique les dates et heures | ||
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | # | + | Username |
| - | # DO NOT EDIT THIS FILE | + | root pts/1 Sat Sep 28 08:43:22 +0200 2024 |
| - | # | + | bin |
| - | # It is automatically generated by grub2-mkconfig using templates | + | daemon |
| - | # from /etc/grub.d and settings from / | + | adm |
| - | # | + | lp **Never logged in** |
| + | sync **Never logged in** | ||
| + | shutdown | ||
| + | halt **Never logged in** | ||
| + | mail **Never logged in** | ||
| + | operator | ||
| + | games | ||
| + | ftp | ||
| + | nobody | ||
| + | systemd-coredump | ||
| + | dbus **Never logged in** | ||
| + | polkitd | ||
| + | avahi | ||
| + | tss | ||
| + | colord | ||
| + | clevis | ||
| + | rtkit | ||
| + | sssd **Never logged in** | ||
| + | geoclue | ||
| + | libstoragemgmt | ||
| + | systemd-oom | ||
| + | setroubleshoot | ||
| + | pipewire | ||
| + | flatpak | ||
| + | gdm tty1 Thu Sep 26 14:55:01 +0200 2024 | ||
| + | cockpit-ws | ||
| + | cockpit-wsinstance | ||
| + | gnome-initial-setup | ||
| + | sshd **Never logged in** | ||
| + | chrony | ||
| + | dnsmasq | ||
| + | tcpdump | ||
| + | trainee | ||
| + | apache | ||
| + | fenestros2 | ||
| + | fenestros1 | ||
| + | </ | ||
| - | ### BEGIN / | + | Les option de cette commande sont : |
| - | set pager=1 | + | |
| - | if [ -f ${config_directory}/ | + | < |
| - | load_env | + | [root@redhat9 ~]# lastlog |
| - | elif [ -s $prefix/ | + | Usage: lastlog |
| - | | + | |
| - | fi | + | |
| - | if [ " | + | |
| - | set default=" | + | |
| - | set next_entry= | + | |
| - | | + | |
| - | set boot_once=true | + | |
| - | else | + | |
| - | set default=" | + | |
| - | fi | + | |
| - | if [ x" | + | Options: |
| - | | + | -b, --before DAYS print only lastlog records older than DAYS |
| - | else | + | -C, --clear |
| - | | + | |
| - | fi | + | -R, --root CHROOT_DIR |
| + | -S, --set set lastlog record to current time (usable only with -u) | ||
| + | -t, --time DAYS print only lastlog records more recent than DAYS | ||
| + | -u, --user LOGIN print lastlog record of the specified LOGIN | ||
| + | </ | ||
| - | export menuentry_id_option | + | ====1.3 - La Commande lastb==== |
| - | if [ " | + | Cette commande indique les dates et heures des connexions infructueuses des utilisateurs à partir du contenu du fichier **/ |
| - | set saved_entry=" | + | |
| - | save_env saved_entry | + | |
| - | set prev_saved_entry= | + | |
| - | save_env prev_saved_entry | + | |
| - | set boot_once=true | + | |
| - | fi | + | |
| - | function savedefault { | + | < |
| - | | + | [root@redhat9 ~]# lastb |
| - | | + | root |
| - | save_env saved_entry | + | root |
| - | | + | |
| - | } | + | |
| - | function load_video { | + | btmp begins Thu Oct 19 18:29:22 2023 |
| - | if [ x$feature_all_video_module = xy ]; then | + | </ |
| - | insmod all_video | + | |
| - | else | + | |
| - | insmod efi_gop | + | |
| - | insmod efi_uga | + | |
| - | insmod ieee1275_fb | + | |
| - | insmod vbe | + | |
| - | insmod vga | + | |
| - | insmod video_bochs | + | |
| - | insmod video_cirrus | + | |
| - | fi | + | |
| - | } | + | |
| - | terminal_output console | + | Les options de cette commande sont : |
| - | if [ x$feature_timeout_style = xy ] ; then | + | |
| - | set timeout_style=menu | + | |
| - | set timeout=5 | + | |
| - | # Fallback normal timeout code in case the timeout_style feature is | + | |
| - | # unavailable. | + | |
| - | else | + | |
| - | set timeout=5 | + | |
| - | fi | + | |
| - | ### END / | + | |
| - | ### BEGIN / | + | < |
| - | set tuned_params="" | + | [root@redhat9 ~]# lastb --help |
| - | set tuned_initrd="" | + | |
| - | ### END / | + | |
| - | ### BEGIN / | + | Usage: |
| - | if [ " | + | lastb [options] [< |
| - | set last_boot_ok=1 | + | |
| - | else | + | |
| - | set last_boot_ok=0 | + | |
| - | fi | + | |
| - | # Reset boot_indeterminate after a successful boot | + | Show a listing of last logged in users. |
| - | if [ " | + | |
| - | set boot_indeterminate=0 | + | |
| - | # Avoid boot_indeterminate causing the menu to be hidden more then once | + | |
| - | elif [ " | + | |
| - | set boot_indeterminate=2 | + | |
| - | fi | + | |
| - | set boot_success=0 | + | |
| - | save_env boot_success boot_indeterminate | + | |
| - | if [ x$feature_timeout_style = xy ] ; then | + | Options: |
| - | if [ " | + | -< |
| - | unset menu_show_once | + | -a, --hostlast |
| - | | + | -d, --dns translate the IP number back into a hostname |
| - | | + | -f, --file < |
| - | set timeout=60 | + | -F, --fulltimes |
| - | elif [ " | + | -i, --ip |
| - | set orig_timeout_style=${timeout_style} | + | -n, --limit < |
| - | set orig_timeout=${timeout} | + | -R, --nohostname |
| - | if [ " | + | -s, --since < |
| - | # timeout_style=menu + timeout=0 avoids | + | -t, --until < |
| - | set timeout_style=menu | + | -p, --present < |
| - | | + | -w, --fullnames |
| - | | + | -x, --system |
| - | set timeout_style=hidden | + | --time-format < |
| - | set timeout=1 | + | notime|short|full|iso |
| - | fi | + | |
| - | | + | |
| - | fi | + | |
| - | ### END / | + | |
| - | ### BEGIN / | + | -h, --help |
| - | if [ -f ${prefix}/ | + | -V, --version |
| - | | + | |
| - | if [ -n " | + | |
| - | set superusers=" | + | |
| - | export superusers | + | |
| - | password_pbkdf2 root ${GRUB2_PASSWORD} | + | |
| - | fi | + | |
| - | fi | + | |
| - | ### END / | + | |
| - | ### BEGIN /etc/grub.d/10_linux ### | + | For more details see last(1). |
| - | insmod part_msdos | + | </code> |
| - | 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 2ae4c035-9244-458c-82c5-a49ae169cdb6 | + | |
| - | fi | + | |
| - | insmod part_msdos | + | |
| - | insmod ext2 | + | |
| - | set boot=' | + | |
| - | if [ x$feature_platform_search_hint = xy ]; then | + | |
| - | search --no-floppy --fs-uuid --set=boot --hint-bios=hd0, | + | |
| - | else | + | |
| - | search --no-floppy --fs-uuid --set=boot 2ae4c035-9244-458c-82c5-a49ae169cdb6 | + | |
| - | fi | + | |
| - | # This section was generated by a script. Do not modify the generated file - all changes | + | ====1.4 - Le Fichier |
| - | # will be lost the next time file is regenerated. Instead edit the BootLoaderSpec files. | + | |
| - | # | + | |
| - | # The blscfg command parses the BootLoaderSpec files stored in /boot/loader/entries and | + | |
| - | # populates the boot menu. Please refer to the Boot Loader Specification documentation | + | |
| - | # for the files format: https:// | + | |
| - | set default_kernelopts=" | + | Sous RHEL 9 ce fichier contient la journalisation des opérations de gestion des authentifications : |
| - | insmod blscfg | + | < |
| - | blscfg | + | [root@redhat9 ~]# tail -n 15 /var/log/ |
| - | ### END /etc/grub.d/10_linux ### | + | Sep 27 14:08:31 redhat9 passwd[10515]: |
| + | Sep 27 14:21:40 redhat9 su[10537]: pam_unix(su: | ||
| + | Sep 27 14:21:50 redhat9 su[10537]: pam_unix(su: | ||
| + | Sep 27 14:22:01 redhat9 su[10561]: pam_unix(su-l: | ||
| + | Sep 27 14:23:49 redhat9 su[10561]: pam_unix(su-l: | ||
| + | Sep 27 17:23:32 redhat9 sshd[9392]: Received disconnect from 10.0.2.1 port 37560:11: disconnected by user | ||
| + | Sep 27 17:23:32 redhat9 sshd[9392]: Disconnected from user trainee 10.0.2.1 port 37560 | ||
| + | Sep 27 17:23:32 redhat9 sshd[9357]: pam_unix(sshd: | ||
| + | Sep 27 17:23:32 redhat9 su[10062]: pam_unix(su-l: | ||
| + | Sep 28 08:09:13 redhat9 sshd[11965]: | ||
| + | Sep 28 08:09:13 redhat9 systemd[11972]: | ||
| + | Sep 28 08:09:13 redhat9 sshd[11965]: | ||
| + | Sep 28 08:43:17 redhat9 sshd[12053]: | ||
| + | Sep 28 08:43:17 redhat9 sshd[12053]: | ||
| + | Sep 28 08:43:22 redhat9 su[12102]: pam_unix(su-l: | ||
| + | </code> | ||
| - | ### BEGIN /etc/grub.d/ | + | ====1.5 - Gestion des Evénements audit==== |
| - | ### END / | + | |
| - | ### BEGIN /etc/grub.d/20_ppc_terminfo ### | + | ===Le fichier |
| - | ### END /etc/grub.d/ | + | |
| - | ### BEGIN /etc/grub.d/ | + | Ce fichier contient les messages du système |
| - | ### END /etc/grub.d/ | + | |
| - | ### BEGIN / | + | * des appels système, |
| - | ### END /etc/grub.d/ | + | * des accès aux fichiers, |
| + | * des informations en provenance de %%SELinux%%. | ||
| - | ### BEGIN /etc/grub.d/40_custom ### | + | Consultez maintenant le fichier **/var/log/audit.log** : |
| - | # 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. | + | |
| - | ### END / | + | |
| - | ### BEGIN /etc/grub.d/41_custom ### | + | < |
| - | if [ -f ${config_directory}/custom.cfg ]; then | + | [root@redhat9 ~]# tail -n 15 /var/log/audit/ |
| - | | + | type=CRYPTO_KEY_USER msg=audit(1727528067.947: |
| - | elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then | + | type=CRED_ACQ msg=audit(1727528067.948:1047): pid=12618 uid=0 auid=1000 ses=14 subj=system_u: |
| - | | + | type=USER_LOGIN msg=audit(1727528067.994: |
| - | fi | + | type=USER_START msg=audit(1727528067.994: |
| - | ### END /etc/grub.d/41_custom ### | + | type=CRYPTO_KEY_USER msg=audit(1727528067.996: |
| + | type=BPF msg=audit(1727528068.011:1051): prog-id=189 op=LOAD | ||
| + | type=BPF msg=audit(1727528068.011: | ||
| + | type=SERVICE_START msg=audit(1727528068.076: | ||
| + | type=USER_AUTH msg=audit(1727528075.273:1054): pid=12662 uid=1000 auid=1000 ses=14 subj=unconfined_u: | ||
| + | type=USER_ACCT msg=audit(1727528075.276: | ||
| + | type=CRED_ACQ msg=audit(1727528075.277: | ||
| + | type=USER_START msg=audit(1727528075.281:1057): pid=12662 uid=1000 auid=1000 ses=14 subj=unconfined_u: | ||
| + | type=SERVICE_STOP msg=audit(1727528105.326: | ||
| + | type=BPF msg=audit(1727528105.369: | ||
| + | type=BPF msg=audit(1727528105.369: | ||
| </ | </ | ||
| - | Notez que ce fichier ne doit pas être modifié manuellement. En effet, il est généré par la commande **grub2-mkconfig**. | + | La gestion des événements audit se repose sur trois exécutables |
| - | * grub2-mkconfig -o / | + | ===auditd=== |
| - | * grub2-mkconfig -o / | + | |
| - | Lors de l' | + | Cet exécutable est le daemon du système audit. Il est responsable |
| - | + | ||
| - | ===Le fichier | + | |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | # this device map was generated by anaconda | + | # |
| - | (hd0) /dev/sda | + | # This file controls the configuration of the audit daemon |
| - | (hd1) /dev/sda | + | # |
| - | </ | + | |
| - | + | ||
| - | ===Le fichier / | + | |
| - | + | ||
| - | Ce fichier contient la configuration par défaut des paramètres de GRUB 2 : | + | |
| - | < | + | local_events = yes |
| - | [root@centos8 ~]# cat /etc/default/grub | + | write_logs = yes |
| - | GRUB_TIMEOUT=5 | + | log_file = /var/log/audit/ |
| - | GRUB_DISTRIBUTOR="$(sed 's, release .*$,, | + | log_group = root |
| - | GRUB_DEFAULT=saved | + | log_format = ENRICHED |
| - | GRUB_DISABLE_SUBMENU=true | + | flush = INCREMENTAL_ASYNC |
| - | GRUB_TERMINAL_OUTPUT=" | + | freq = 50 |
| - | GRUB_CMDLINE_LINUX=" | + | max_log_file = 8 |
| - | GRUB_DISABLE_RECOVERY=" | + | num_logs |
| - | GRUB_ENABLE_BLSCFG=true | + | priority_boost |
| + | name_format | ||
| + | ## | ||
| + | max_log_file_action | ||
| + | space_left | ||
| + | space_left_action | ||
| + | verify_email | ||
| + | action_mail_acct | ||
| + | admin_space_left = 50 | ||
| + | admin_space_left_action = SUSPEND | ||
| + | disk_full_action = SUSPEND | ||
| + | disk_error_action = SUSPEND | ||
| + | use_libwrap = yes | ||
| + | ## | ||
| + | tcp_listen_queue = 5 | ||
| + | tcp_max_per_addr = 1 | ||
| + | ## | ||
| + | tcp_client_max_idle | ||
| + | transport = TCP | ||
| + | krb5_principal = auditd | ||
| + | ## | ||
| + | distribute_network = no | ||
| + | q_depth = 2000 | ||
| + | overflow_action = SYSLOG | ||
| + | max_restarts = 10 | ||
| + | plugin_dir = / | ||
| + | end_of_event_timeout | ||
| </ | </ | ||
| - | <WRAP center round important 60%> | + | Les option |
| - | **Important** : Notez que toute modification | + | |
| - | </ | + | |
| - | + | ||
| - | Dans ce fichier les directives | + | |
| - | + | ||
| - | ^ Directive | + | |
| - | | GRUB_TIMEOUT | Durée de l' | + | |
| - | | GRUB_DISTRIBUTOR | Ligne de commande qui génère le texte de l' | + | |
| - | | GRUB_DEFAULT | Entrée du menu sélectionner par défaut | | + | |
| - | | GRUB_DISABLE_SUBMENU | Active ou désactive les sous-menus de GRUB2 | | + | |
| - | | GRUB_TERMINAL_OUTPUT | Spécifie le terminal par défaut | | + | |
| - | | GRUB_CMDLINE_LINUX | Paramètres passés au noyau peu importe le type de démarrage | | + | |
| - | | GRUB_DISABLE_RECOVERY | Active ou désactive la génération des entrées en mode **recovery** | | + | |
| - | | GRUB_BLSCFG | Active ou désactive l' | + | |
| - | + | ||
| - | ===Les fichiers du répertoire / | + | |
| - | + | ||
| - | Les fichiers de ce répertoire sont exécutés dans l' | + | |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | total 92 | + | auditd: unrecognized option '--help' |
| - | -rwxr-xr-x. 1 root root 8958 Mar 2 15:51 00_header | + | Usage: auditd [-f] [-l] [-n] [-s disable|enable|nochange] [-c < |
| - | -rwxr-xr-x. 1 root root 1043 Jun 15 2020 00_tuned | + | |
| - | -rwxr-xr-x. 1 root root 232 Mar 2 15:51 01_users | + | |
| - | -rwxr-xr-x. 1 root root 832 Mar 2 15:51 08_fallback_counting | + | |
| - | -rwxr-xr-x. 1 root root 14088 Mar 2 15:51 10_linux | + | |
| - | -rwxr-xr-x. 1 root root 830 Mar 2 15:51 10_reset_boot_success | + | |
| - | -rwxr-xr-x. 1 root root 889 Mar 2 15:51 12_menu_auto_hide | + | |
| - | -rwxr-xr-x. 1 root root 11696 Mar 2 15:51 20_linux_xen | + | |
| - | -rwxr-xr-x. 1 root root 2559 Mar 2 15:51 20_ppc_terminfo | + | |
| - | -rwxr-xr-x. 1 root root 10670 Mar 2 15:51 30_os-prober | + | |
| - | -rwxr-xr-x. 1 root root 1412 Mar 2 15:51 30_uefi-firmware | + | |
| - | -rwxr-xr-x. 1 root root 214 Mar 2 15:51 40_custom | + | |
| - | -rwxr-xr-x. 1 root root 216 Mar 2 15:51 41_custom | + | |
| - | -rw-r--r--. 1 root root 483 Mar 2 15:51 README | + | |
| </ | </ | ||
| - | * **Le fichier / | + | ===auditctl=== |
| - | * Le fichier **10_Linux** contient des boucles pour rechercher des noyaux Linux, | + | |
| - | * **Le fichier / | + | |
| - | * Ce fichier recherche des éventuels systèmes d' | + | |
| - | * **Les fichiers / | + | |
| - | * Ces deux fichiers sont fournis en tant que modèles à personnaliser. | + | |
| - | ===Le Fichier / | + | Cet exécutable est utilisé pour configurer les règles |
| - | + | ||
| - | Le fichier **/ | + | |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | # GRUB Environment Block | + | ## This file is automatically generated from / |
| - | saved_entry=de79af4f226d480fa7d3fec4cabbf97a-4.18.0-240.22.1.el8_3.x86_64 | + | -D |
| - | kernelopts=root=UUID=4c0cc28c-0d59-45be-bd73-d292b80be33c ro crashkernel=auto resume=UUID=c8bb3f47-d67f-4b21-b781-766899dc83d4 rhgb quiet | + | -b 8192 |
| - | boot_success=1 | + | -f 1 |
| - | boot_indeterminate=0 | + | --backlog_wait_time 60000 |
| - | ########################################################################################################################################## | + | |
| - | ########################################################################################################################################## | + | |
| - | ########################################################################################################################################## | + | |
| - | ########################################################################################################################################## | + | |
| - | ########################################################################################################################################## | + | |
| - | ############################################################ | + | |
| - | </ | + | |
| - | ===Modifier la Configuration de GRUB 2 en Ligne de Commande=== | + | [root@redhat9 ~]# ls -l / |
| + | total 4 | ||
| + | -rw-------. 1 root root 244 Oct 19 2023 audit.rules | ||
| - | Lors du démarrage de GRUB 2, trois actions sont possibles à partir du menu : | + | [root@redhat9 ~]# cat / |
| + | ## First rule - delete all | ||
| + | -D | ||
| - | * Lancer un système d' | + | ## Increase the buffers to survive stress events. |
| - | * Lancer l' | + | ## Make this bigger for busy systems |
| - | * Lancer l’interface de la ligne de commande GRUB en appuyant sur la touche **c**. | + | -b 8192 |
| - | En mode édition notez l' | + | ## This determine how long to wait in burst of events |
| + | --backlog_wait_time 60000 | ||
| - | * **flèches** : se déplacer dans l' | + | ## Set failure mode to syslog |
| - | * **Crtl-X** : démarrer avec la configuration modifiée, | + | -f 1 |
| - | * **echap** : abandonner les modifications et retourner à l' | + | |
| - | ====Chargeurs de Démarrages Alternatifs==== | + | </ |
| - | ===Systemd-boot=== | + | Les options de cette commande sont : |
| - | Un Chargeur de Démarrage étroitement lié à Systemd | + | < |
| + | [root@redhat9 ~]# auditctl -h | ||
| + | usage: auditctl [options] | ||
| + | -a < | ||
| + | -A < | ||
| + | -b < | ||
| + | allowed Default=64 | ||
| + | -c Continue through errors in rules | ||
| + | -C f=f Compare collected fields if available: | ||
| + | Field name, operator(=,!=), field name | ||
| + | | ||
| + | l=task, | ||
| + | a=never, | ||
| + | -D Delete all rules and watches | ||
| + | -e [0..2] Set enabled flag | ||
| + | -f [0..2] | ||
| + | 0=silent 1=printk 2=panic | ||
| + | -F f=v Build rule: field name, operator(=, | ||
| + | > | ||
| + | -h Help | ||
| + | -i Ignore errors when reading rules from file | ||
| + | -k < | ||
| + | -l List rules | ||
| + | -m text Send a user-space message | ||
| + | -p [r|w|x|a] | ||
| + | r=read, w=write, x=execute, a=attribute | ||
| + | -q < | ||
| + | -r < | ||
| + | -R < | ||
| + | -s Report status | ||
| + | -S syscall | ||
| + | --signal < | ||
| + | -t Trim directory watches | ||
| + | -v Version | ||
| + | -w < | ||
| + | -W < | ||
| + | --loginuid-immutable | ||
| + | --backlog_wait_time | ||
| + | --reset-lost | ||
| + | --reset_backlog_wait_time_actual | ||
| + | There was an error while processing parameters | ||
| + | </ | ||
| - | ===U-boot=== | + | ===La consultation des événements audit=== |
| - | Un Chargeur de Démarrage qui peut booter n' | + | La consultation des événements audit se fait en utilisant les commandes **ausearch** et **aureport** : |
| - | ===Le Projet Syslinux=== | + | ==La Commande aureport== |
| - | ==SYSLINUX== | + | Cette commande est utilisée pour générer des rapports : |
| - | Un Chargeur de Démarrage pour les systèmes qui utilisent le système de fichier FAT. Par exemple le systèmes sur clefs USB. | + | < |
| + | [root@redhat9 ~]# aureport | ||
| - | ==EXTLINUX== | + | Summary Report |
| + | ====================== | ||
| + | Range of time in logs: 10/19/2023 18: | ||
| + | Selected time for report: 10/19/2023 18:27:19 - 09/28/2024 14: | ||
| + | Number of changes in configuration: | ||
| + | Number of changes to accounts, groups, or roles: 30 | ||
| + | Number of logins: 12 | ||
| + | Number of failed logins: 0 | ||
| + | Number of authentications: | ||
| + | Number of failed authentications: | ||
| + | Number of users: 4 | ||
| + | Number of terminals: 9 | ||
| + | Number of host names: 4 | ||
| + | Number of executables: | ||
| + | Number of commands: 11 | ||
| + | Number of files: 0 | ||
| + | Number of AVC's: 0 | ||
| + | Number of MAC events: 41 | ||
| + | Number of failed syscalls: 0 | ||
| + | Number of anomaly events: 0 | ||
| + | Number of responses to anomaly events: 0 | ||
| + | Number of crypto events: 104 | ||
| + | Number of integrity events: 0 | ||
| + | Number of virt events: 0 | ||
| + | Number of keys: 0 | ||
| + | Number of process IDs: 158 | ||
| + | Number of events: 2567 | ||
| + | </ | ||
| - | Un Chargeur | + | Les options |
| - | ==ISOLINUX== | + | < |
| + | [root@redhat9 ~]# aureport --help | ||
| + | usage: aureport [options] | ||
| + | -a, | ||
| + | -au, | ||
| + | --comm | ||
| + | -c, | ||
| + | -cr, | ||
| + | --debug | ||
| + | --eoe-timeout secs End of Event Timeout | ||
| + | -e, | ||
| + | --escape option | ||
| + | -f, | ||
| + | --failed | ||
| + | -h, | ||
| + | --help | ||
| + | -i, | ||
| + | -if,--input <Input File name> | ||
| + | --input-logs | ||
| + | --integrity | ||
| + | -k, | ||
| + | -l, | ||
| + | -m, | ||
| + | -ma, | ||
| + | -n, | ||
| + | -nc, | ||
| + | --node <node name> | ||
| + | -p, | ||
| + | -r, | ||
| + | -s, | ||
| + | --success | ||
| + | --summary | ||
| + | -t, | ||
| + | -te,--end [end date] [end time] ending date & time for reports | ||
| + | -tm, | ||
| + | -ts,--start [start date] [start time] | ||
| + | --tty | ||
| + | -u, | ||
| + | -v, | ||
| + | --virt | ||
| + | -x, | ||
| + | If no report is given, the summary report will be displayed | ||
| + | </ | ||
| - | Un Chargeur de Démarrage pour booter des LiveCD et LiveDVD. Dans le cas d' | + | ==La Commande ausearch== |
| - | * **isolinux.bin** qui contient l' | + | Cette commande est utilisée pour rechercher des événements. Par exemple, pour rechercher |
| - | * **isolinux.cfg** qui contient | + | |
| - | ==PXELINUX== | + | < |
| - | + | [root@redhat9 ~]# ausearch -ui 1000 | more | |
| - | Un Chargeur de Démarrage pour booter à partir d'un serveur réseau. Ce système utilise le standard **PXE** | + | ---- |
| + | time-> | ||
| + | type=USER_AUTH msg=audit(1697732960.285: | ||
| + | tname=? addr=? terminal=/ | ||
| + | ---- | ||
| + | time-> | ||
| + | type=USER_AUTH msg=audit(1697732971.707: | ||
| + | su" hostname=? addr=? terminal=/ | ||
| + | ---- | ||
| + | time-> | ||
| + | type=USER_ACCT msg=audit(1697732971.746:145): pid=6294 uid=1000 auid=1000 ses=3 subj=unconfined_u: | ||
| + | "/ | ||
| + | ---- | ||
| + | time-> | ||
| + | type=CRED_ACQ msg=audit(1697732971.747: | ||
| + | name=? addr=? terminal=/ | ||
| + | ---- | ||
| + | time-> | ||
| + | type=USER_START msg=audit(1697732971.835: | ||
| + | am_systemd, | ||
| + | ---- | ||
| + | time-> | ||
| + | type=USER_AUTH msg=audit(1697733321.865: | ||
| + | su" hostname=? addr=? terminal=/ | ||
| + | ---- | ||
| + | time-> | ||
| + | type=USER_ACCT msg=audit(1697733321.905: | ||
| + | "/ | ||
| + | ---- | ||
| + | time-> | ||
| + | type=CRED_ACQ msg=audit(1697733321.905: | ||
| + | name=? addr=? terminal=/ | ||
| + | ---- | ||
| + | time-> | ||
| + | type=USER_START msg=audit(1697733321.909: | ||
| + | am_systemd, | ||
| + | ---- | ||
| + | time-> | ||
| + | type=USER_END msg=audit(1697733340.703: | ||
| + | m_systemd, | ||
| + | ---- | ||
| + | time-> | ||
| + | type=CRED_DISP msg=audit(1697733340.704: | ||
| + | tname=? addr=? terminal=/ | ||
| + | ---- | ||
| + | time-> | ||
| + | type=USER_AUTH msg=audit(1727252106.538: | ||
| + | su" hostname=? addr=? terminal=/ | ||
| + | ---- | ||
| + | time-> | ||
| + | type=USER_ACCT msg=audit(1727252106.579: | ||
| + | "/ | ||
| + | ---- | ||
| + | time-> | ||
| + | type=CRED_ACQ msg=audit(1727252106.579: | ||
| + | --More-- | ||
| + | [q] | ||
| + | </ | ||
| - | * **DHCP** pour attribuer une adresse IP à la machine et | + | Les options |
| - | * **BOOTP** pour charger l' | + | |
| - | ===Isodhpfx=== | + | < |
| + | [root@redhat9 ~]# ausearch --help | ||
| + | usage: ausearch [options] | ||
| + | -a,--event <Audit event id> | ||
| + | --arch < | ||
| + | -c, | ||
| + | --checkpoint < | ||
| + | --debug | ||
| + | -e, | ||
| + | -escape < | ||
| + | --eoe-timeout secs End of Event timeout | ||
| + | --extra-keys | ||
| + | --extra-labels | ||
| + | --extra-obj2 | ||
| + | --extra-time | ||
| + | -f, | ||
| + | --format [raw|default|interpret|csv|text] results format options | ||
| + | -ga, | ||
| + | -ge, | ||
| + | group id | ||
| + | -gi,--gid <Group Id> | ||
| + | -h, | ||
| + | -hn,--host <Host Name> | ||
| + | -i, | ||
| + | -if,--input <Input File name> | ||
| + | --input-logs | ||
| + | --just-one | ||
| + | -k, | ||
| + | -l, --line-buffered | ||
| + | -m, | ||
| + | -n, | ||
| + | -o, | ||
| + | -p, | ||
| + | -pp,--ppid <Parent Process id> | ||
| + | -r, | ||
| + | -sc, | ||
| + | -se, | ||
| + | | ||
| + | --session <login session id> | ||
| + | -su, | ||
| + | -sv, | ||
| + | success value | ||
| + | -te,--end [end date] [end time] ending date & time for search | ||
| + | -ts,--start [start date] [start time] | ||
| + | -tm, | ||
| + | -ua, | ||
| + | -ue, | ||
| + | user id | ||
| + | -ui,--uid <User Id> | ||
| + | -ul, | ||
| + | -uu,--uuid <guest UUID> | ||
| + | machine with the given UUID. | ||
| + | -v, | ||
| + | -vm, | ||
| + | machine with the name. | ||
| + | -w, | ||
| + | -x, | ||
| + | </ | ||
| - | Un Chargeur | + | <WRAP center round important 60%> |
| + | **Important** : Pour plus d' | ||
| + | </ | ||
| - | ====Initramfs==== | + | =====Le fichier / |
| - | Le fichier | + | Ce fichier |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | [root@centos8 ~]# cd /tmp | + | Sep 28 13:33:57 redhat9 systemd[1]: dnf-makecache.service: Consumed |
| - | [root@centos8 tmp]# ls | + | Sep 28 13:35:04 redhat9 cupsd[5736]: |
| - | cpio.list | + | Sep 28 14:33:24 redhat9 cupsd[5736]: REQUEST localhost - - " |
| - | custom | + | Sep 28 14:54:27 redhat9 systemd-logind[5671]: New session 14 of user trainee. |
| - | dateref | + | Sep 28 14:54:27 redhat9 systemd[1]: Started Session 14 of User trainee. |
| - | incremental.tar | + | Sep 28 14:54:28 redhat9 systemd[1]: Starting Hostname Service... |
| - | mbr.save | + | Sep 28 14:54:28 redhat9 systemd[1]: Started Hostname Service. |
| - | systemd-private-9af7a2f7444849578f55b306bfd9f820-chronyd.service-iQiNzF | + | Sep 28 14:54:35 redhat9 su[12662]: (to root) trainee on pts/1 |
| - | tblpart.save | + | Sep 28 14:55:05 redhat9 systemd[1]: systemd-hostnamed.service: |
| - | test.cpio | + | Sep 28 14:57:20 redhat9 systemd[1]: Starting Cleanup of Temporary Directories... |
| - | test.print | + | Sep 28 14:57:20 redhat9 systemd[1]: |
| - | test.tar | + | Sep 28 14:57:20 redhat9 systemd[1]: Finished Cleanup of Temporary Directories. |
| - | tmp.iso | + | Sep 28 14:57:20 redhat9 systemd[1]: run-credentials-systemd\x2dtmpfiles\x2dclean.service.mount: |
| - | vg0_backup | + | Sep 28 15:02:37 redhat9 systemd[5851]: |
| + | Sep 28 15:02:37 redhat9 systemd[5851]: | ||
| + | </ | ||
| - | [root@centos8 tmp]# mv custom custom.gz | + | =====Applications===== |
| - | [root@centos8 tmp]# gunzip custom.gz | + | Certaines applications consignent leurs journaux dans des répertoires spécifiques. Par exemple : |
| - | [root@centos8 tmp]# mkdir initramfs | + | * cups, |
| + | * httpd, | ||
| + | * samba, | ||
| + | * ... | ||
| - | [root@centos8 tmp]# cd initramfs | + | < |
| - | + | [root@redhat9 ~]# ls -l /var/log | |
| - | [root@centos8 initramfs]# cpio -cid -I ../custom | + | total 1952 |
| - | 216 blocks | + | drwxr-xr-x. 2 root root 4096 Oct 19 2023 anaconda |
| - | [root@centos8 initramfs]# ls | + | drwx------. 2 root |
| - | bin dev etc init lib lib64 proc | + | -rw-------. 1 root |
| + | -rw-------. 1 root | ||
| + | -rw-rw----. 1 root utmp 768 Sep 25 11:41 btmp | ||
| + | drwxr-x---. 2 chrony chrony | ||
| + | -rw-------. 1 root | ||
| + | drwxr-xr-x. 2 lp | ||
| + | -rw-r--r--. 1 root | ||
| + | -rw-r--r--. 1 root | ||
| + | -rw-r--r--. 1 root | ||
| + | -rw-r-----. 1 root | ||
| + | drwx--x--x. 2 root | ||
| + | -rw-r--r--. 1 root | ||
| + | drwx------. 2 root | ||
| + | drwx------. 2 root | ||
| + | -rw-------. 1 root | ||
| + | -rw-rw-r--. 1 root | ||
| + | -rw-------. 1 root | ||
| + | -rw-------. 1 root | ||
| + | drwx------. 2 root | ||
| + | drwxr-xr-x. 2 root | ||
| + | lrwxrwxrwx. 1 root | ||
| + | drwxr-xr-x. 2 root root 43 Jan 18 2024 rhsm | ||
| + | drwx------. 3 root | ||
| + | -rw-------. 1 root | ||
| + | drwx------. 2 root | ||
| + | -rw-------. 1 root | ||
| + | drwxr-x---. 2 sssd | ||
| + | -rw-------. 1 root | ||
| + | drwxr-xr-x. 2 root | ||
| + | -rw-rw-r--. 1 root | ||
| </ | </ | ||
| - | ===Examiner l' | + | =====LAB #2 - rsyslog===== |
| - | Pour examiner une image initramfs archivée, il convient d' | + | **rsyslog**, |
| - | < | + | rsyslog apporte des améliorations par rapport à syslogd |
| - | [root@centos8 tmp]# lsinitrd custom | more | + | |
| - | Image: custom: 25M | + | |
| - | ======================================================================== | + | |
| - | Early CPIO image | + | |
| - | ======================================================================== | + | |
| - | drwxr-xr-x | + | |
| - | -rw-r--r-- | + | |
| - | drwxr-xr-x | + | |
| - | drwxr-xr-x | + | |
| - | drwxr-xr-x | + | |
| - | -rw-r--r-- | + | |
| - | ======================================================================== | + | |
| - | Version: dracut-049-95.git20200804.el8_3.4 | + | |
| - | Arguments: -f --kver | + | * l'addition du protocole **TCP** pour la communication, |
| + | * la haute disponibilité, | ||
| + | * l' | ||
| - | dracut modules: | + | Les messages de journalisation envoyés à rsyslog sont marqués avec un **Sous-système applicatif** et une **Priorité**. Le binôme Sous-système applicatif/Priorité s' |
| - | bash | + | |
| - | systemd | + | |
| - | systemd-initrd | + | |
| - | nss-softokn | + | |
| - | rngd | + | |
| - | i18n | + | |
| - | network-legacy | + | |
| - | network | + | |
| - | ifcfg | + | |
| - | drm | + | |
| - | plymouth | + | |
| - | prefixdevname | + | |
| - | kernel-modules | + | |
| - | kernel-modules-extra | + | |
| - | kernel-network-modules | + | |
| - | resume | + | |
| - | rootfs-block | + | |
| - | terminfo | + | |
| - | udev-rules | + | |
| - | biosdevname | + | |
| - | dracut-systemd | + | |
| - | usrmount | + | |
| - | base | + | |
| - | fs-lib | + | |
| - | memstrack | + | |
| - | microcode_ctl-fw_dir_override | + | |
| - | shutdown | + | |
| - | ======================================================================== | + | |
| - | drwxr-xr-x | + | |
| - | crw-r--r-- | + | |
| - | crw-r--r-- | + | |
| - | crw-r--r-- | + | |
| - | crw-r--r-- | + | |
| - | crw-r--r-- | + | |
| - | lrwxrwxrwx | + | |
| - | drwxr-xr-x | + | |
| - | drwxr-xr-x | + | |
| - | -rw-r--r-- | + | |
| - | drwxr-xr-x | + | |
| - | drwxr-xr-x | + | |
| - | -rw-r--r-- | + | |
| - | --More-- | + | |
| - | </ | + | |
| - | ===Le script init=== | + | rsyslog décide ensuite de l' |
| - | RHEL/CentOS 8 utilise le système de démarrage | + | * ignorer les informations, |
| + | * envoyer les informations à un rsyslog sur une autre machine (par exemple, **@machine2**), | ||
| + | * inscrire les informations dans un fichier sur disque (par exemple, **/var/ | ||
| + | | ||
| + | * transmettre les informations à tous les utilisateurs (par exemple *****), | ||
| + | * transmettre les informations à une application liée à rsyslog via un tube (par exemple, **|logrotate**). | ||
| + | |||
| + | Sous RHEL 9, le daemon rsyslog | ||
| < | < | ||
| - | [root@centos8 tmp]# lsinitrd custom | grep usr/lib/systemd/systemd | grep init | + | [root@redhat9 ~]# cat /etc/sysconfig/rsyslog |
| - | lrwxrwxrwx | + | # Options for rsyslogd |
| + | # Syslogd options are deprecated since rsyslog v3. | ||
| + | # If you want to use them, switch to compatibility mode 2 by "-c 2" | ||
| + | # See rsyslogd(8) for more details | ||
| + | SYSLOGD_OPTIONS="" | ||
| </ | </ | ||
| - | ===Consulter | + | L' |
| - | Pour consulter le contenu d'un fichier inclus dans l' | + | ^ Directive ^ Version ^ |
| + | | SYSLOGD_OPTIONS=" | ||
| + | | SYSLOGD_OPTIONS=" | ||
| + | | SYSLOGD_OPTIONS=" | ||
| - | < | + | ====2.1 |
| - | [root@centos8 tmp]# lsinitrd / | + | |
| - | include ld.so.conf.d/ | + | |
| - | </ | + | |
| - | ====Processus de Démarrage du Noyau Linux==== | + | La **Priorité** permet d' |
| - | Le processus de démarrage du Noyau Linux peut être divisé en 6 étapes : | + | ^ Niveau ^ Priorité ^ Description ^ |
| + | | 0 | emerg/panic | Système inutilisable | | ||
| + | | 1 | alert | Action immédiate requise | | ||
| + | | 2 | crit | Condition critique atteinte | | ||
| + | | 3 | err/error | Erreurs rencontrées | | ||
| + | | 4 | warning/ | ||
| + | | 5 | notice | Condition normale - message important | | ||
| + | | 6 | info | Condition normale - message simple | | ||
| + | | 7 | debug | Condition normale - message de débogage | | ||
| - | ^ Etape ^ Description ^ | + | ====2.2 - Sous-systèmes applicatifs==== |
| - | | Chargement, configuration et exécution du chargeur du noyau | Le fichier **bootsect.s** est chargé en mémoire par le BIOS. Une fois configuré celui-ci charge le reste du noyau en mémoire | | + | |
| - | | Configuration des paramètres et bascule vers le mode 32 bits | Le fichier **boot.s** met en place un **[[http:// | + | |
| - | | Décompression du Noyau | Le fichier **head.s** décompresse le noyau | | + | |
| - | | Initialisation du noyau et de la mémoire | Le fichier **head.s** crée un GDT et IDT définitif | | + | |
| - | | Configuration du noyau | Le fichier **main.c** met en place les contraintes de mémoire et configure la mémoire virtuelle | | + | |
| - | | Création du processus Init | Le fichier **main.c** crée le processus init | | + | |
| - | La fonction | + | Le **Sous-système applicatif**, aussi appelé **facility**, |
| - | * /sbin/init ==> / | + | ^ Fonction ^ Description ^ |
| - | | + | | auth/auth-priv | Message de sécurité |
| - | * /bin/init | + | | cron | Message de cron ou at | |
| - | * /bin/sh ==> /bin/bash ==> / | + | | daemon | Message d'un daemon | |
| + | | kern | Message du noyau | | ||
| + | | lpr | Message du système d' | ||
| + | | mail | Message du système de mail | | ||
| + | | news | Message du système de news | | ||
| + | | syslog | Message interne de rsyslogd | | ||
| + | | user | Message utilisateur | | ||
| + | | uucp | Message du système UUCP | | ||
| + | | local0 - local7 | Réservés pour des utilisations locales | | ||
| - | Dans le cas d'un échec à ce stade le message **Kernel Panic** sera affiché. | ||
| - | =====Systemd===== | + | ====2.3 - / |
| - | Les systèmes de démarrage antérieurs à Systemd, | + | rsyslog est configuré par le fichier |
| - | **Systemd** essaie, par contre, de démarrer autant de services en parallèle que possible. Ceci est rendu possible car la majorité d' | + | < |
| + | [root@redhat9 ~]# cat / | ||
| + | # rsyslog configuration file | ||
| - | Au lieu de parler de scripts de démarrage et de niveaux d' | + | # For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html |
| + | # or latest version online at http://www.rsyslog.com/doc/ | ||
| + | # If you experience problems, see http:// | ||
| - | * **.automount** - active la fonctionalité d' | + | #### GLOBAL DIRECTIVES #### |
| - | * **.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 sous surveillance par le système. | + | |
| - | * **.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' | + | |
| - | Une Cible est en quelque sorte une **grande étape** dans le démarrage du système : | + | # Where to place auxiliary files |
| + | global(workDirectory="/ | ||
| - | * **halt.target** - arrête le système. | + | # Use default timestamp format |
| - | * **poweroff.target** - arrête le système et coupe le courant. | + | module(load=" |
| - | * **shutdown.target** - arrête le système. | + | |
| - | * **rescue.target** - démarre le système en mode single-user | + | |
| - | * **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. | + | |
| - | **Systemd** utilise des Cibles d'une manière similaire à ce que **SysVinit** utilise des niveaux d' | + | #### MODULES #### |
| - | < | + | module(load=" |
| - | [root@centos8 ~]# ls -l / | + | |
| - | lrwxrwxrwx. 1 root root 15 Apr 7 16:55 / | + | # local messages are retrieved through imjournal now. |
| - | lrwxrwxrwx. 1 root root 13 Apr 7 16:55 /usr/lib/systemd/ | + | module(load=" |
| - | lrwxrwxrwx. 1 root root 17 Apr 7 16:55 / | + | UsePid=" |
| - | lrwxrwxrwx. 1 root root 17 Apr 7 16:55 / | + | |
| - | lrwxrwxrwx. 1 root root 17 Apr 7 16:55 / | + | StateFile=" |
| - | lrwxrwxrwx. 1 root root 16 Apr 7 16:55 / | + | # |
| - | lrwxrwxrwx. 1 root root 13 Apr 7 16:55 / | + | # |
| - | /usr/lib/systemd/system/runlevel1.target.wants: | + | # Include all config files in /etc/rsyslog.d/ |
| - | total 0 | + | include(file=" |
| - | /usr/lib/systemd/system/ | + | # Provides UDP syslog reception |
| - | total 0 | + | # for parameters see http://www.rsyslog.com/doc/imudp.html |
| + | # | ||
| + | # | ||
| - | /usr/lib/systemd/system/ | + | # Provides TCP syslog reception |
| - | total 0 | + | # for parameters see http://www.rsyslog.com/doc/imtcp.html |
| + | # | ||
| + | # | ||
| - | / | + | #### RULES #### |
| - | total 0 | + | |
| - | / | + | # Log all kernel messages to the console. |
| - | total 0 | + | # Logging much else clutters up the screen. |
| - | </code> | + | # |
| - | ====LAB | + | # Log anything (except mail) of level info or higher. |
| + | # Don't log private authentication messages! | ||
| + | *.info; | ||
| - | Pour visualiser la liste des Unités, il convient d' | + | # The authpriv file has restricted access. |
| + | authpriv.* / | ||
| - | < | + | # Log all the mail messages in one place. |
| - | [root@centos8 ~]# systemctl list-units | + | mail.* |
| - | UNIT LOAD | + | |
| - | 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-net-virbr0.device | + | |
| - | sys-devices-virtual-net-virbr0\x2dnic.device | + | |
| - | sys-module-configfs.device | + | |
| - | sys-subsystem-net-devices-enp0s3.device | + | |
| - | sys-subsystem-net-devices-virbr0.device | + | |
| - | sys-subsystem-net-devices-virbr0\x2dnic.device | + | |
| - | -.mount | + | |
| - | boot.mount | + | |
| - | dev-hugepages.mount | + | |
| - | dev-mqueue.mount | + | |
| - | run-user-1000.mount | + | |
| - | sys-kernel-config.mount | + | |
| - | sys-kernel-debug.mount | + | |
| - | sys-kernel-tracing.mount | + | |
| - | var-lib-nfs-rpc_pipefs.mount | + | |
| - | cups.path | + | |
| - | systemd-ask-password-plymouth.path | + | |
| - | systemd-ask-password-wall.path | + | |
| - | init.scope | + | |
| - | session-96.scope | + | |
| - | atd.service | + | |
| - | auditd.service | + | |
| - | avahi-daemon.service | + | |
| - | chronyd.service | + | |
| - | crond.service | + | |
| - | cups.service | + | |
| - | dbus.service | + | |
| - | dracut-shutdown.service | + | |
| - | firewalld.service | + | |
| - | lines 1-57 | + | |
| - | </code> | + | |
| - | Pour consulter la liste des Unités inactifs, utilisez la commande suivante : | ||
| - | < | + | # Log cron stuff |
| - | [root@centos8 ~]# systemctl list-units --all | grep inactive | more | + | cron.* |
| - | ● boot.automount | + | |
| - | proc-fs-nfsd.mount | + | |
| - | proc-sys-fs-binfmt_misc.mount | + | |
| - | sys-fs-fuse-connections.mount | + | |
| - | ● sysroot.mount | + | |
| - | tmp.mount | + | |
| - | | + | |
| - | systemd-ask-password-console.path | + | |
| - | ● apparmor.service | + | |
| - | auth-rpcgss-module.service | + | |
| - | cpupower.service | + | |
| - | ● display-manager.service | + | |
| - | dm-event.service | + | |
| - | dnf-makecache.service | + | |
| - | dracut-cmdline.service | + | |
| - | dracut-initqueue.service | + | |
| - | dracut-mount.service | + | |
| - | dracut-pre-mount.service | + | |
| - | dracut-pre-pivot.service | + | |
| - | dracut-pre-trigger.service | + | |
| - | dracut-pre-udev.service | + | |
| - | ebtables.service | + | |
| - | emergency.service | + | |
| - | initrd-cleanup.service | + | |
| - | initrd-parse-etc.service | + | |
| - | initrd-switch-root.service | + | |
| - | initrd-udevadm-cleanup-db.service | + | |
| - | ● ip6tables.service | + | |
| - | ● ipset.service | + | |
| - | ● iptables.service | + | |
| - | iscsi-onboot.service | + | |
| - | iscsi.service | + | |
| - | iscsid.service | + | |
| - | iscsiuio.service | + | |
| - | ldconfig.service | + | |
| - | libvirt-guests.service | + | |
| - | libvirtd.service | + | |
| - | loadmodules.service | + | |
| - | ● lvm2-activation.service | + | |
| - | lvm2-lvmpolld.service | + | |
| - | mdmonitor.service | + | |
| - | microcode.service | + | |
| - | ● network.service | + | |
| - | nfs-blkmap.service | + | |
| - | nfs-convert.service | + | |
| - | nfs-idmapd.service | + | |
| - | nfs-mountd.service | + | |
| - | nfs-server.service | + | |
| - | nfs-utils.service | + | |
| - | nfsdcld.service | + | |
| - | nftables.service | + | |
| - | ● ntpd.service | + | |
| - | ● ntpdate.service | + | |
| - | plymouth-switch-root.service | + | |
| - | rc-local.service | + | |
| - | rescue.service | + | |
| - | rpc-gssd.service | + | |
| - | --More-- | + | |
| - | </code> | + | |
| - | Les points noirs au début de certaines lignes dans la sortie ci-dessus sont en réalité des points blancs à l' | + | # Everybody gets emergency messages |
| + | *.emerg : | ||
| - | < | + | # Save news errors of level crit and higher in a special file. |
| - | [root@centos8 ~]# systemctl status ntpd | + | uucp, |
| - | Unit ntpd.service could not be found. | + | |
| - | </code> | + | |
| - | Pour consulter la liste des Unités ainsi que leurs statuts, utilisez la commande suivante : | + | # Save boot messages also to boot.log |
| + | local7.* | ||
| - | < | + | |
| - | [root@centos8 ~]# systemctl list-unit-files | more | + | # ### sample forwarding rule ### |
| - | UNIT FILE STATE | + | # |
| - | proc-sys-fs-binfmt_misc.automount | + | # # An on-disk queue is created for this action. If the remote host is |
| - | -.mount | + | # # down, messages are spooled to disk and sent when it is up again. |
| - | boot.mount | + | #queue.filename=" |
| - | dev-hugepages.mount | + | #queue.maxdiskspace=" |
| - | dev-mqueue.mount | + | #queue.saveonshutdown=" |
| - | proc-fs-nfsd.mount | + | #queue.type=" |
| - | proc-sys-fs-binfmt_misc.mount | + | #action.resumeRetryCount=" |
| - | sys-fs-fuse-connections.mount | + | # # Remote Logging (we use TCP for reliable delivery) |
| - | sys-kernel-config.mount | + | # # remote_host is: name/ip, e.g. 192.168.0.1, port optional e.g. 10514 |
| - | sys-kernel-debug.mount | + | # |
| - | tmp.mount | + | |
| - | var-lib-machines.mount | + | |
| - | var-lib-nfs-rpc_pipefs.mount | + | |
| - | cups.path | + | |
| - | systemd-ask-password-console.path static | + | |
| - | systemd-ask-password-plymouth.path | + | |
| - | systemd-ask-password-wall.path | + | |
| - | session-96.scope | + | |
| - | arp-ethers.service | + | |
| - | atd.service | + | |
| - | auditd.service | + | |
| - | auth-rpcgss-module.service | + | |
| - | autovt@.service | + | |
| - | avahi-daemon.service | + | |
| - | blk-availability.service | + | |
| - | chrony-dnssrv@.service | + | |
| - | chrony-wait.service | + | |
| - | chronyd.service | + | |
| - | cockpit-motd.service | + | |
| - | cockpit-wsinstance-http-redirect.service | + | |
| - | cockpit-wsinstance-http.service | + | |
| - | cockpit-wsinstance-https-factory@.service | + | |
| - | cockpit-wsinstance-https@.service | + | |
| - | cockpit.service | + | |
| - | console-getty.service | + | |
| - | container-getty@.service | + | |
| - | cpupower.service | + | |
| - | crond.service | + | |
| - | cups-browsed.service | + | |
| - | cups.service | + | |
| - | dbus-org.fedoraproject.FirewallD1.service | + | |
| - | dbus-org.freedesktop.Avahi.service | + | |
| - | dbus-org.freedesktop.hostname1.service | + | |
| - | dbus-org.freedesktop.import1.service | + | |
| - | dbus-org.freedesktop.locale1.service | + | |
| - | dbus-org.freedesktop.login1.service | + | |
| - | dbus-org.freedesktop.machine1.service | + | |
| - | dbus-org.freedesktop.nm-dispatcher.service | + | |
| - | dbus-org.freedesktop.portable1.service | + | |
| - | dbus-org.freedesktop.timedate1.service | + | |
| - | dbus.service | + | |
| - | debug-shell.service | + | |
| - | dm-event.service | + | |
| - | dnf-makecache.service | + | |
| - | dnsmasq.service | + | |
| - | dracut-cmdline.service | + | |
| - | --More-- | + | |
| </ | </ | ||
| - | Pour visualiser les Unités d'un type spécifique, | + | Ce fichier est divisé en 3 parties |
| - | < | + | * **Modules**, |
| - | [root@centos8 ~]# systemctl list-unit-files -t mount | + | |
| - | UNIT FILE | + | * **Directives Globales** (//Global Directives// |
| - | -.mount | + | * Section traitant les options de comportement global du service rsyslog, |
| - | boot.mount | + | * **Règles** (// |
| - | dev-hugepages.mount | + | * Section traitant les règles de configuration des journaux. Les règles au format syslogd gardent le même format. Les nouvelles règles, compatibles seulement avec rsyslog commencent par **module**. |
| - | dev-mqueue.mount static | + | |
| - | proc-fs-nfsd.mount static | + | |
| - | proc-sys-fs-binfmt_misc.mount static | + | |
| - | sys-fs-fuse-connections.mount static | + | |
| - | sys-kernel-config.mount | + | |
| - | sys-kernel-debug.mount | + | |
| - | tmp.mount | + | |
| - | var-lib-machines.mount | + | |
| - | var-lib-nfs-rpc_pipefs.mount | + | |
| - | 12 unit files listed. | + | ===Modules=== |
| - | </ | + | |
| - | Dans la colonne STATE on voit les mots **static** et **generated**. | + | Depuis |
| - | | + | ^ Module ^ Fonction ^ |
| - | * Ceci implique que l' | + | | module(load=" |
| + | | module(load=" | ||
| + | | module(load=" | ||
| + | | module(load=" | ||
| + | | module(load=" | ||
| + | | module(load=" | ||
| - | * STATE = generated | + | Dans le fichier **/etc/rsyslog.conf** nous pouvons constater que les inputs |
| - | * 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' | + | |
| - | <code> | + | <file> |
| - | [root@centos8 ~]# ls -l / | + | ... |
| - | -rwxr-xr-x. 1 root root 46096 Apr 7 16:56 / | + | #### MODULES #### |
| - | </ | + | |
| - | Il existe aussi d' | + | module(load=" |
| + | | ||
| + | # local messages are retrieved through imjournal now. | ||
| + | module(load=" | ||
| + | | ||
| + | | ||
| + | | ||
| + | # | ||
| + | # | ||
| + | ... | ||
| + | </ | ||
| - | < | + | Pour activer la réception de messages à partir de serveurs rsyslog distants en utilisant le protocole **UDP**, il convient de décommenter les directives de chargement de modules dans le fichier **/etc/rsyslog.conf** et de re-démarrer le service |
| - | [root@centos8 ~]# ls -l /lib/systemd/ | + | |
| - | total 508 | + | |
| - | -rwxr-xr-x. 1 root root 504 Jan 4 11:25 kdump-dep-generator.sh | + | |
| - | -r-xr-xr-x. 1 root root 134976 Aug 17 2020 lvm2-activation-generator | + | |
| - | -rwxr-xr-x. 1 root root 67792 Jul 20 2020 nfs-server-generator | + | |
| - | -rwxr-xr-x. 1 root root 38216 Jul 20 2020 rpc-pipefs-generator | + | |
| - | -rwxr-xr-x. 1 root root 743 Apr 23 2020 selinux-autorelabel-generator.sh | + | |
| - | -rwxr-xr-x. 1 root root 33504 Apr 7 16:56 systemd-cryptsetup-generator | + | |
| - | -rwxr-xr-x. 1 root root 16648 Apr 7 16:56 systemd-debug-generator | + | |
| - | -rwxr-xr-x. 1 root root 46096 Apr 7 16:56 systemd-fstab-generator | + | |
| - | -rwxr-xr-x. 1 root root 17064 Apr 7 16:56 systemd-getty-generator | + | |
| - | -rwxr-xr-x. 1 root root 29432 Apr 7 16:56 systemd-gpt-auto-generator | + | |
| - | -rwxr-xr-x. 1 root root 12568 Apr 7 16:56 systemd-hibernate-resume-generator | + | |
| - | -rwxr-xr-x. 1 root root 12368 Apr 7 16:56 systemd-rc-local-generator | + | |
| - | -rwxr-xr-x. 1 root root 12408 Apr 7 16:56 systemd-system-update-generator | + | |
| - | -rwxr-xr-x. 1 root root 33544 Apr 7 16:56 systemd-sysv-generator | + | |
| - | -rwxr-xr-x. 1 root root 17024 Apr 7 16:56 systemd-veritysetup-generator | + | |
| - | </ | + | |
| - | Les options de la commande **systemctl** sont : | + | < |
| + | ... | ||
| + | # Provides UDP syslog reception | ||
| + | # for parameters see http:// | ||
| + | # | ||
| + | # | ||
| - | < | + | # Provides TCP syslog reception |
| - | [root@centos8 ~]# systemctl --help | + | # for parameters see http://www.rsyslog.com/ |
| - | systemctl [OPTIONS...] {COMMAND} | + | # |
| + | # | ||
| + | ... | ||
| + | </ | ||
| - | Query or send control commands to the systemd manager. | + | <WRAP center round important 60%> |
| + | **Important** : Les deux directives **module(load=" | ||
| + | </ | ||
| - | -h --help | + | Pour envoyer |
| - | | + | |
| - | | + | |
| - | | + | |
| - | -H --host=[USER@]HOST | + | |
| - | Operate on remote host | + | |
| - | -M --machine=CONTAINER | + | |
| - | Operate on local container | + | |
| - | -t --type=TYPE | + | |
| - | | + | |
| - | -p --property=NAME | + | |
| - | -a --all Show all properties/ | + | |
| - | including dead/empty 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 | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | Do not ask for system passwords | + | |
| - | | + | |
| - | | + | |
| - | reboot | + | |
| - | -f --force | + | |
| - | When shutting down, execute action immediately | + | |
| - | | + | |
| - | | + | |
| - | directory | + | |
| - | -n --lines=INTEGER | + | |
| - | -o --output=STRING | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | lines 1-57 | + | < |
| - | </code> | + | ... |
| + | # ### sample forwarding rule ### | ||
| + | # | ||
| + | # # An on-disk queue is created for this action. If the remote host is | ||
| + | # # down, messages are spooled to disk and sent when it is up again. | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # # Remote Logging (we use TCP for reliable delivery) | ||
| + | # # remote_host is: name/ip, e.g. 192.168.0.1, | ||
| + | # | ||
| + | ... | ||
| + | </file> | ||
| - | ====LAB #2 - Fichiers | + | <WRAP center round important 60%> |
| + | **Important** : Ces directives utilisent le protocole TCP. Le serveur distant doit donc être configuré pour ce mode de communication. La directive **Target=" | ||
| + | </ | ||
| - | ===2.1 - Fichiers de Configuration par Défaut=== | + | ===Directives Globales=== |
| - | Les fichiers de configuration des Cibles et fichiers de configuration des Unités installés par des paquets se trouvent | + | Les directives |
| - | <code> | + | <file> |
| - | [root@centos8 ~]# pkg-config systemd --variable=systemdsystemunitdir | + | module(load=" |
| - | / | + | </file> |
| - | </code> | + | |
| - | < | + | Cette directive stipule que le format des entrées dans les fichiers de journalisation **ne doit pas** être au format d' |
| - | [root@centos8 ~]# ls -l / | + | |
| - | total 1464 | + | |
| - | -rw-r--r--. 1 root root 275 Apr 26 2020 arp-ethers.service | + | |
| - | -rw-r--r--. 1 root root 222 May 11 2019 atd.service | + | |
| - | -rw-r--r--. 1 root root 1512 Apr 23 2020 auditd.service | + | |
| - | -rw-r--r--. 1 root root 628 Jul 20 2020 auth-rpcgss-module.service | + | |
| - | lrwxrwxrwx. 1 root root 14 Apr 7 16:55 autovt@.service -> getty@.service | + | |
| - | -rw-r--r--. 1 root root 1044 Nov 16 2020 avahi-daemon.service | + | |
| - | -rw-r--r--. 1 root root 870 Nov 16 2020 avahi-daemon.socket | + | |
| - | -rw-r--r--. 1 root root 956 Apr 7 16:54 basic.target | + | |
| - | drwxr-xr-x. 2 root root 6 Apr 7 16:55 basic.target.wants | + | |
| - | -r--r--r--. 1 root root 408 Aug 17 2020 blk-availability.service | + | |
| - | -rw-r--r--. 1 root root 419 Jun 22 2018 bluetooth.target | + | |
| - | -rw-r--r--. 1 root root 455 Apr 7 16:54 boot-complete.target | + | |
| - | -rw-r--r--. 1 root root 209 Nov 19 2019 chrony-dnssrv@.service | + | |
| - | -rw-r--r--. 1 root root 138 Nov 19 2019 chrony-dnssrv@.timer | + | |
| - | -rw-r--r--. 1 root root 491 Nov 19 2019 chronyd.service | + | |
| - | -rw-r--r--. 1 root root 472 May 10 2019 chrony-wait.service | + | |
| - | -rw-r--r--. 1 root root 222 Aug 24 2020 cockpit-motd.service | + | |
| - | -rw-r--r--. 1 root root 835 Aug 24 2020 cockpit.service | + | |
| - | -rw-r--r--. 1 root root 373 Aug 24 2020 cockpit.socket | + | |
| - | -rw-r--r--. 1 root root 251 Aug 24 2020 cockpit-wsinstance-http-redirect.service | + | |
| - | -rw-r--r--. 1 root root 233 Aug 24 2020 cockpit-wsinstance-http-redirect.socket | + | |
| - | -rw-r--r--. 1 root root 221 Aug 24 2020 cockpit-wsinstance-http.service | + | |
| - | -rw-r--r--. 1 root root 165 Aug 24 2020 cockpit-wsinstance-https-factory@.service | + | |
| - | -rw-r--r--. 1 root root 244 Aug 24 2020 cockpit-wsinstance-https-factory.socket | + | |
| - | -rw-r--r--. 1 root root 215 Aug 24 2020 cockpit-wsinstance-http.socket | + | |
| - | -rw-r--r--. 1 root root 264 Aug 24 2020 cockpit-wsinstance-https@.service | + | |
| - | -rw-r--r--. 1 root root 478 Aug 24 2020 cockpit-wsinstance-https@.socket | + | |
| - | -rw-r--r--. 1 root root 1082 Apr 7 16:55 console-getty.service | + | |
| - | -rw-r--r--. 1 root root 1263 Apr 7 16:55 container-getty@.service | + | |
| - | -rw-r--r--. 1 root root 294 Apr 8 15:21 cpupower.service | + | |
| - | -rw-r--r--. 1 root root 356 Nov 8 2019 crond.service | + | |
| - | -rw-r--r--. 1 root root 465 Jun 22 2018 cryptsetup-pre.target | + | |
| - | -rw-r--r--. 1 root root 412 Jun 22 2018 cryptsetup.target | + | |
| - | lrwxrwxrwx. 1 root root 13 Apr 7 16:55 ctrl-alt-del.target -> reboot.target | + | |
| - | -rw-r--r--. 1 root root 234 Oct 4 2017 cups-browsed.service | + | |
| - | -r--r--r--. 1 root root 142 Jun 15 2020 cups.path | + | |
| - | -r--r--r--. 1 root root 248 Jun 15 2020 cups.service | + | |
| - | -r--r--r--. 1 root root 136 Jun 15 2020 cups.socket | + | |
| - | lrwxrwxrwx. 1 root root 25 Apr 7 16:55 dbus-org.freedesktop.hostname1.service -> systemd-hostnamed.service | + | |
| - | lrwxrwxrwx. 1 root root 23 Apr 7 16:55 dbus-org.freedesktop.import1.service -> systemd-importd.service | + | |
| - | lrwxrwxrwx. 1 root root 23 Apr 7 16:55 dbus-org.freedesktop.locale1.service -> systemd-localed.service | + | |
| - | lrwxrwxrwx. 1 root root 22 Apr 7 16:55 dbus-org.freedesktop.login1.service -> systemd-logind.service | + | |
| - | lrwxrwxrwx. 1 root root 24 Apr 7 16:55 dbus-org.freedesktop.machine1.service -> systemd-machined.service | + | |
| - | lrwxrwxrwx. 1 root root 25 Apr 7 16:55 dbus-org.freedesktop.portable1.service -> systemd-portabled.service | + | |
| - | lrwxrwxrwx. 1 root root 25 Apr 7 16:55 dbus-org.freedesktop.timedate1.service -> systemd-timedated.service | + | |
| - | -rw-r--r--. 1 root root 380 Apr 7 12:08 dbus.service | + | |
| - | -rw-r--r--. 1 root root 102 Apr 7 12:08 dbus.socket | + | |
| - | drwxr-xr-x. 2 root root 6 Apr 7 16:55 dbus.target.wants | + | |
| - | -rw-r--r--. 1 root root 1084 Apr 7 16:55 debug-shell.service | + | |
| - | lrwxrwxrwx. 1 root root 16 Apr 7 16:55 default.target -> graphical.target | + | |
| - | drwxr-xr-x. 2 root root 6 Apr 7 16:55 default.target.wants | + | |
| - | -rw-r--r--. 1 root root 750 Jun 22 2018 dev-hugepages.mount | + | |
| - | -rw-r--r--. 1 root root 665 Jun 22 2018 dev-mqueue.mount | + | |
| - | -r--r--r--. 1 root root 345 Aug 17 2020 dm-event.service | + | |
| - | -r--r--r--. 1 root root 248 Aug 17 2020 dm-event.socket | + | |
| - | -rw-r--r--. 1 root root 457 Jun 2 2020 dnf-makecache.service | + | |
| - | --More-- | + | |
| - | </ | + | |
| - | Certains fichiers de configuration sont créés à la volée dans le répertoire **/ | + | ===Règles=== |
| - | < | + | Chaque règle prend la forme suivante : |
| - | [root@centos8 ~]# ls -l / | + | |
| - | total 0 | + | |
| - | </ | + | |
| - | Les fichiers de configuration des Unités crées par les utilisateurs doivent être mis dans le répertoire **/usr/ | + | < |
| + | Sélecteur[; | ||
| + | </file> | ||
| - | < | + | Un Sélecteur est défini d'une des façons suivantes : |
| - | [root@centos8 ~]# pkg-config systemd --variable=systemduserunitdir | + | |
| - | / | + | |
| - | </ | + | |
| - | <WRAP center round important 60%> | + | ==Sous-système applicatif.Priorité== |
| - | **Important** : De cette façon les fichiers dans **/ | + | |
| - | </ | + | |
| - | Prenons le cas du service **sshd** qui est configuré par le fichier **/ | + | Dans ce cas on ne tient compte que des messages de priorité égale ou supérieure à la Priorité indiquée. |
| - | < | + | ==Sous-système applicatif!Priorité== |
| - | [root@centos8 ~]# cat / | + | |
| - | [Unit] | + | |
| - | Description=OpenSSH server daemon | + | |
| - | Documentation=man:sshd(8) man: | + | |
| - | After=network.target sshd-keygen.target | + | |
| - | Wants=sshd-keygen.target | + | |
| - | [Service] | + | Dans ce cas on ne tient compte que des messages de priorité inférieure à la Priorité indiquée. |
| - | Type=notify | + | |
| - | EnvironmentFile=-/ | + | |
| - | EnvironmentFile=-/ | + | |
| - | ExecStart=/ | + | |
| - | ExecReload=/ | + | |
| - | KillMode=process | + | |
| - | Restart=on-failure | + | |
| - | RestartSec=42s | + | |
| - | [Install] | + | ==Sous-système applicatif=Priorité== |
| - | WantedBy=multi-user.target | + | |
| - | </ | + | |
| - | Dans le fichier | + | Dans ce cas on ne tient compte que des messages de priorité égale à la Priorité indiquée. |
| - | * **Description=OpenSSH server daemon**, | + | ==L'utilisation du caractère spécial |
| - | * Cette directive est utilisée pour donner une courte description des fonctionnalités de l' | + | |
| - | * **Documentation=man:sshd(8) man: | + | |
| - | * Cette directive stipule les chapitres des manuels et les URLs contenant de l'information en relation avec l' | + | |
| - | | + | |
| - | * Cette directive indique les cibles qui devraient être atteintes et les Unités qui devraient être démarrées avant l' | + | |
| - | * **Wants=sshd-keygen.target**, | + | |
| - | * Cette directive stipule une dépendance douce. Autrement dit, Systemd essayera de démarrer l' | + | |
| - | Dans le fichier on peut aussi noter la présence des lignes suivantes dans la section | + | La valeur du Sous-système applicatif et/ou de la Priorité |
| - | * **Type=notify**, | + | ==n Sous-systèmes avec la même priorité== |
| - | * Cette directive indique que le service informera Systemd quand son démarrage a terminé, | + | |
| - | * **ExecStart=/ | + | |
| - | * Cette directive définit l' | + | |
| - | * **ExecReload=/ | + | |
| - | * Cette directive indique | + | |
| - | * **KillMode=process**, | + | |
| - | * Cette directive indique comment les processus du service doivent être arrêtés. La valeur de **process** implique l' | + | |
| - | * **Restart=on-failure**, | + | |
| - | * Cette ligne indique que le service doit être re-démarré en cas d' | + | |
| - | * **RestartSec=42s**, | + | |
| - | * Cette directive stipule le temps d' | + | |
| - | Dernièrement on note la présence de la ligne suivante dans la section | + | Plusieurs Sous-systèmes applicatifs peuvent être stipulés pour la même Priorité en les séparant avec un **virgule**. Par exemple |
| - | * **WantedBy=multi-user.target**, | + | ==n Sélecteurs avec la même Action== |
| - | * Cette directive indique | + | |
| - | Pour consulter | + | Une Action peut s' |
| - | < | ||
| - | [root@centos8 ~]# systemctl show sshd | ||
| - | Type=notify | ||
| - | Restart=on-failure | ||
| - | NotifyAccess=main | ||
| - | RestartUSec=42s | ||
| - | TimeoutStartUSec=1min 30s | ||
| - | TimeoutStopUSec=1min 30s | ||
| - | RuntimeMaxUSec=infinity | ||
| - | WatchdogUSec=0 | ||
| - | WatchdogTimestamp=Thu 2021-06-03 15:09:54 EDT | ||
| - | WatchdogTimestampMonotonic=12502561 | ||
| - | PermissionsStartOnly=no | ||
| - | RootDirectoryStartOnly=no | ||
| - | RemainAfterExit=no | ||
| - | GuessMainPID=yes | ||
| - | MainPID=902 | ||
| - | ControlPID=0 | ||
| - | FileDescriptorStoreMax=0 | ||
| - | NFileDescriptorStore=0 | ||
| - | StatusErrno=0 | ||
| - | Result=success | ||
| - | UID=[not set] | ||
| - | GID=[not set] | ||
| - | NRestarts=0 | ||
| - | ExecMainStartTimestamp=Thu 2021-06-03 15:09:54 EDT | ||
| - | ExecMainStartTimestampMonotonic=12446178 | ||
| - | ExecMainExitTimestampMonotonic=0 | ||
| - | ExecMainPID=902 | ||
| - | ExecMainCode=0 | ||
| - | ExecMainStatus=0 | ||
| - | ExecStart={ path=/ | ||
| - | ExecReload={ path=/ | ||
| - | Slice=system.slice | ||
| - | ControlGroup=/ | ||
| - | MemoryCurrent=6270976 | ||
| - | CPUUsageNSec=[not set] | ||
| - | EffectiveCPUs= | ||
| - | EffectiveMemoryNodes= | ||
| - | TasksCurrent=1 | ||
| - | IPIngressBytes=18446744073709551615 | ||
| - | IPIngressPackets=18446744073709551615 | ||
| - | IPEgressBytes=18446744073709551615 | ||
| - | IPEgressPackets=18446744073709551615 | ||
| - | Delegate=no | ||
| - | CPUAccounting=no | ||
| - | CPUWeight=[not set] | ||
| - | StartupCPUWeight=[not set] | ||
| - | CPUShares=[not set] | ||
| - | StartupCPUShares=[not set] | ||
| - | CPUQuotaPerSecUSec=infinity | ||
| - | CPUQuotaPeriodUSec=infinity | ||
| - | AllowedCPUs= | ||
| - | AllowedMemoryNodes= | ||
| - | IOAccounting=no | ||
| - | IOWeight=[not set] | ||
| - | StartupIOWeight=[not set] | ||
| - | BlockIOAccounting=no | ||
| - | BlockIOWeight=[not set] | ||
| - | lines 1-57 | ||
| - | </ | ||
| - | Pour consulter la liste des dépendances | + | <WRAP center round important 60%> |
| + | **Important** : Une Action précédée par le signe **-** est entreprise | ||
| + | </ | ||
| - | < | + | =====LAB |
| - | [root@centos8 ~]# systemctl list-dependencies sshd.service | + | |
| - | sshd.service | + | |
| - | ● ├─system.slice | + | |
| - | ● ├─sshd-keygen.target | + | |
| - | ● │ ├─sshd-keygen@ecdsa.service | + | |
| - | ● │ ├─sshd-keygen@ed25519.service | + | |
| - | ● │ └─sshd-keygen@rsa.service | + | |
| - | ● └─sysinit.target | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● | + | |
| - | ● │ ├─-.mount | + | |
| - | ● │ ├─boot.mount | + | |
| - | ● │ └─systemd-remount-fs.service | + | |
| - | ● | + | |
| - | ● | + | |
| - | </ | + | |
| - | ===2.2 - Surchargement | + | La commande **/ |
| - | Les fichiers | + | La syntaxe |
| - | + | ||
| - | < | + | |
| - | [root@centos8 ~]# pkg-config systemd --variable=systemdsystemunitpath | + | |
| - | / | + | |
| - | </ | + | |
| - | + | ||
| - | < | + | |
| - | [root@centos8 ~]# ls -l / | + | |
| - | total 4 | + | |
| - | drwxr-xr-x. 2 root root 31 May 8 2020 basic.target.wants | + | |
| - | lrwxrwxrwx. 1 root root 41 May 8 2020 dbus-org.fedoraproject.FirewallD1.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 44 Jun 3 14:02 dbus-org.freedesktop.Avahi.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 57 May 8 2020 dbus-org.freedesktop.nm-dispatcher.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 41 May 8 2020 dbus-org.freedesktop.timedate1.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 37 May 8 2020 default.target -> / | + | |
| - | drwxr-xr-x. 2 root root 32 May 8 2020 getty.target.wants | + | |
| - | drwxr-xr-x. 2 root root 4096 Jun 3 14:02 multi-user.target.wants | + | |
| - | drwxr-xr-x. 2 root root 48 May 8 2020 network-online.target.wants | + | |
| - | drwxr-xr-x. 2 root root 33 Apr 19 12:07 nfs-blkmap.service.requires | + | |
| - | drwxr-xr-x. 2 root root 33 Apr 19 12:07 nfs-idmapd.service.requires | + | |
| - | drwxr-xr-x. 2 root root 33 Apr 19 12:07 nfs-mountd.service.requires | + | |
| - | drwxr-xr-x. 2 root root 33 Apr 19 12:07 nfs-server.service.requires | + | |
| - | drwxr-xr-x. 2 root root 26 Jun 3 14:02 printer.target.wants | + | |
| - | drwxr-xr-x. 2 root root 52 Apr 19 12:07 remote-fs.target.wants | + | |
| - | drwxr-xr-x. 2 root root 33 Apr 19 12:07 rpc-gssd.service.requires | + | |
| - | drwxr-xr-x. 2 root root 33 Apr 19 12:07 rpc-statd-notify.service.requires | + | |
| - | drwxr-xr-x. 2 root root 33 Apr 19 12:07 rpc-statd.service.requires | + | |
| - | drwxr-xr-x. 2 root root 260 Jun 3 14:02 sockets.target.wants | + | |
| - | drwxr-xr-x. 2 root root 235 Apr 19 12:07 sysinit.target.wants | + | |
| - | lrwxrwxrwx. 1 root root 39 May 8 2020 syslog.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 9 May 11 2019 systemd-timedated.service -> /dev/null | + | |
| - | drwxr-xr-x. 2 root root 34 May 8 2020 timers.target.wants | + | |
| - | </ | + | |
| - | ====LAB #3 - La Commande systemd-analyze==== | + | < |
| + | logger | ||
| + | </ | ||
| - | Pour avoir une évaluation du temps de démarrage, il convient d' | + | Par exemple saisissez |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | Startup finished in 1.665s (kernel) + 6.977s (initrd) + 8.458s (userspace) = 17.101s | + | |
| - | multi-user.target reached after 5.528s in userspace | + | |
| </ | </ | ||
| - | L' | + | Consultez |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | 4.080s dracut-initqueue.service | + | Sep 28 15:05:26 redhat9 dnf[12735]: Extra Packages for Enterprise Linux 9 openh264 |
| - | | + | Sep 28 15:05:26 redhat9 dnf[12735]: Extra Packages for Enterprise Linux 9 - Next - 199 kB/s | 26 kB 00:00 |
| - | 1.727s tuned.service | + | Sep 28 15:05:27 redhat9 dnf[12735]: Red Hat Enterprise Linux 9 for x86_64 |
| - | 1.415s initrd-switch-root.service | + | Sep 28 15:05:27 redhat9 dnf[12735]: Red Hat Enterprise Linux 9 for x86_64 |
| - | | + | Sep 28 15:05:28 redhat9 dnf[12735]: Red Hat CodeReady Linux Builder for RHEL 9 x86_ 34 kB/s | 4.5 kB 00:00 |
| - | | + | Sep 28 15:05:28 redhat9 dnf[12735]: Metadata cache created. |
| - | | + | Sep 28 15:05:28 redhat9 |
| - | 850ms sssd.service | + | Sep 28 15:05:28 redhat9 |
| - | 791ms vdo.service | + | Sep 28 15:05:28 redhat9 |
| - | 713ms firewalld.service | + | Sep 28 15:15:29 redhat9 |
| - | 622ms lvm2-monitor.service | + | |
| - | 605ms polkit.service | + | |
| - | 508ms chronyd.service | + | |
| - | 434ms avahi-daemon.service | + | |
| - | | + | |
| - | 417ms netcf-transaction.service | + | |
| - | 410ms dracut-pre-udev.service | + | |
| - | 295ms libvirtd.service | + | |
| - | | + | |
| - | 243ms systemd-udevd.service | + | |
| - | 221ms systemd-journald.service | + | |
| - | 196ms systemd-tmpfiles-setup.service | + | |
| - | 151ms dracut-pre-pivot.service | + | |
| - | 139ms sysroot.mount | + | |
| - | 139ms systemd-update-utmp-runlevel.service | + | |
| - | 122ms systemd-vconsole-setup.service | + | |
| - | 110ms lvm2-pvscan@8:25.service | + | |
| - | 98ms systemd-udev-trigger.service | + | |
| - | 82ms gssproxy.service | + | |
| - | 81ms cups.service | + | |
| - | 79ms initrd-parse-etc.service | + | |
| - | 77ms NetworkManager.service | + | |
| - | 72ms lvm2-pvscan@8:23.service | + | |
| - | 69ms systemd-user-sessions.service | + | |
| - | 68ms lvm2-pvscan@8:22.service | + | |
| - | 67ms unbound-anchor.service | + | |
| - | 66ms rsyslog.service | + | |
| - | 62ms boot.mount | + | |
| - | 56ms sshd.service | + | |
| - | 54ms smartd.service | + | |
| - | 54ms systemd-fsck@dev-disk-by\x2duuid-2ae4c035\x2d9244\x2d458c\x2d82c5\x2da49ae169cdb6.service | + | |
| - | 53ms user@1000.service | + | |
| - | 52ms auditd.service | + | |
| - | 51ms plymouth-quit.service | + | |
| - | 49ms rngd-wake-threshold.service | + | |
| - | 46ms import-state.service | + | |
| - | 46ms systemd-tmpfiles-setup-dev.service | + | |
| - | 43ms ksmtuned.service | + | |
| - | 42ms plymouth-quit-wait.service | + | |
| - | 42ms var-lib-nfs-rpc_pipefs.mount | + | |
| - | 42ms rpc-statd-notify.service | + | |
| - | 38ms plymouth-switch-root.service | + | |
| - | 37ms systemd-remount-fs.service | + | |
| - | 37ms plymouth-start.service | + | |
| - | 33ms dev-disk-by\x2duuid-c8bb3f47\x2dd67f\x2d4b21\x2db781\x2d766899dc83d4.swap | + | |
| - | 33ms systemd-tmpfiles-clean.service | + | |
| - | 31ms dev-hugepages.mount | + | |
| - | lines 1-57 | + | |
| </ | </ | ||
| - | L' | + | Les options |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | The time after the unit is active or started is printed after the " | + | |
| - | The time the unit takes to start is printed after the " | + | |
| - | sshd.service +56ms | + | Usage: |
| - | └─network.target @3.799s | + | logger [options] [<message>] |
| - | └─NetworkManager.service @3.719s +77ms | + | |
| - | └─network-pre.target @3.718s | + | |
| - | └─firewalld.service @3.004s +713ms | + | |
| - | └─polkit.service @2.397s +605ms | + | |
| - | └─basic.target @2.392s | + | |
| - | └─sockets.target @2.392s | + | |
| - | └─sssd-kcm.socket @2.391s | + | |
| - | └─sysinit.target @2.379s | + | |
| - | └─systemd-update-utmp.service @2.370s +8ms | + | |
| - | └─auditd.service @2.317s +52ms | + | |
| - | └─systemd-tmpfiles-setup.service @2.118s +196ms | + | |
| - | └─import-state.service @2.070s +46ms | + | |
| - | └─local-fs.target @2.069s | + | |
| - | └─boot.mount @2.006s +62ms | + | |
| - | └─systemd-fsck@dev-disk-by\x2duuid-2ae4c035\x2d9244\x2d458c\x2d82c5\x2da49ae169cdb6.service @1.943s +54ms | + | |
| - | └─local-fs-pre.target @1.942s | + | |
| - | └─lvm2-monitor.service @1.319s +622ms | + | |
| - | └─dm-event.socket @1.317s | + | |
| - | └─-.mount | + | |
| - | └─system.slice | + | |
| - | └─-.slice | + | |
| - | </code> | + | |
| - | Les options de la commande **systemd-analyze** sont : | + | Enter messages into the system log. |
| - | + | ||
| - | < | + | |
| - | [root@centos7 ~]# systemd-analyze --help | + | |
| - | systemd-analyze [OPTIONS...] {COMMAND} ... | + | |
| - | Process systemd profiling information | + | Options: |
| + | | ||
| + | | ||
| + | -f, --file < | ||
| + | -e, --skip-empty | ||
| + | | ||
| + | -p, --priority < | ||
| + | | ||
| + | | ||
| + | -s, --stderr | ||
| + | -S, --size < | ||
| + | -t, --tag < | ||
| + | -n, --server < | ||
| + | -P, --port < | ||
| + | -T, --tcp use TCP only | ||
| + | -d, --udp use UDP only | ||
| + | | ||
| + | | ||
| + | < | ||
| + | | ||
| + | | ||
| + | | ||
| + | -u, --socket < | ||
| + | | ||
| + | print connection errors when using Unix sockets | ||
| + | | ||
| - | | + | -h, --help |
| - | | + | -V, --version |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | 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 | + | |
| - | unless specified with a different unit, i.e. 50ms | + | |
| - | | + | |
| - | Commands: | + | For more details see logger(1). |
| - | time Print time spent in the kernel before reaching userspace | + | |
| - | blame Print list of running units ordered by time to init | + | |
| - | critical-chain | + | |
| - | plot Output SVG graphic showing service initialization | + | |
| - | dot | + | |
| - | set-log-level LEVEL Set logging threshold for systemd | + | |
| - | dump Output state serialization of service manager | + | |
| </ | </ | ||
| - | ====LAB #4 - Les Cibles Systemd==== | + | =====LAB #4 - La Commande logrotate===== |
| - | Chaque Cible est décrite par un fichier | + | Les fichiers journaux grossissent régulièrement. Le programme **/ |
| + | |||
| + | Visualisez le fichier **/ | ||
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | # | + | # see "man logrotate" |
| - | # | + | |
| - | # 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 | + | |
| - | # (at your option) any later version. | + | |
| - | [Unit] | + | # global options do not affect preceding include directives |
| - | Description=Graphical Interface | + | |
| - | Documentation=man: | + | |
| - | Requires=multi-user.target | + | |
| - | Wants=display-manager.service | + | |
| - | Conflicts=rescue.service rescue.target | + | |
| - | After=multi-user.target rescue.service rescue.target display-manager.service | + | |
| - | AllowIsolate=yes | + | |
| - | </ | + | |
| - | Dans ce fichier on peut noter la présence des lignes suivantes : | + | # rotate log files weekly |
| + | weekly | ||
| - | * **Requires=multi-user.target**, | + | # keep 4 weeks worth of backlogs |
| - | * Cette ligne indique que le **graphical.target** ne peut pas être atteint si le **multi-user.target** n'a pas été atteint au préalable, | + | rotate 4 |
| - | * **After=multi-user.target rescue.service rescue.target display-manager.service**, | + | |
| - | * Cette ligne indique le **multi-user.target** et **rescue.target** doivent d' | + | |
| - | * **Conflicts=rescue.service rescue.target**, | + | |
| - | * Cette ligne indique la Cible et le service en conflits avec le **graphical.target**, | + | |
| - | * **Wants=display-manager.service**, | + | |
| - | * Cette ligne indique quel service doit être démarré. | + | |
| - | ===4.1 - Contrôler les dépendances d'une Cible=== | + | # create new (empty) log files after rotating old ones |
| + | create | ||
| - | Les dépendances d'une Cible peuvent être consultées en utilisant la commande **systemctl list-dependencies** : | + | # use date as a suffix of the rotated file |
| + | dateext | ||
| - | < | + | # uncomment this if you want your log files compressed |
| - | [root@centos8 ~]# systemctl list-dependencies multi-user.target | + | #compress |
| - | multi-user.target | + | |
| - | ● ├─atd.service | + | |
| - | ● ├─auditd.service | + | |
| - | ● ├─avahi-daemon.service | + | |
| - | ● ├─chronyd.service | + | |
| - | ● ├─crond.service | + | |
| - | ● ├─cups.path | + | |
| - | ● ├─cups.service | + | |
| - | ● ├─dbus.service | + | |
| - | ● ├─dnf-makecache.timer | + | |
| - | ● ├─firewalld.service | + | |
| - | ● ├─irqbalance.service | + | |
| - | ● ├─kdump.service | + | |
| - | ● ├─ksm.service | + | |
| - | ● ├─ksmtuned.service | + | |
| - | ● ├─libstoragemgmt.service | + | |
| - | ● ├─libvirtd.service | + | |
| - | ● ├─mcelog.service | + | |
| - | ● ├─mdmonitor.service | + | |
| - | ● ├─netcf-transaction.service | + | |
| - | ● ├─NetworkManager.service | + | |
| - | ● ├─plymouth-quit-wait.service | + | |
| - | ● ├─plymouth-quit.service | + | |
| - | ● ├─rpcbind.service | + | |
| - | ● ├─rsyslog.service | + | |
| - | ● ├─smartd.service | + | |
| - | ● ├─sshd.service | + | |
| - | ● ├─sssd.service | + | |
| - | ● ├─systemd-ask-password-wall.path | + | |
| - | ● ├─systemd-logind.service | + | |
| - | ● ├─systemd-update-utmp-runlevel.service | + | |
| - | ● ├─systemd-user-sessions.service | + | |
| - | ● ├─tuned.service | + | |
| - | ● ├─vdo.service | + | |
| - | ● ├─basic.target | + | |
| - | ● │ ├─-.mount | + | |
| - | ● │ ├─microcode.service | + | |
| - | ● │ ├─paths.target | + | |
| - | ● │ ├─slices.target | + | |
| - | ● │ │ ├─-.slice | + | |
| - | ● │ │ └─system.slice | + | |
| - | ● │ ├─sockets.target | + | |
| - | ● │ │ ├─avahi-daemon.socket | + | |
| - | ● │ │ ├─cups.socket | + | |
| - | ● │ │ ├─dbus.socket | + | |
| - | ● │ │ ├─dm-event.socket | + | |
| - | ● │ │ ├─iscsid.socket | + | |
| - | ● │ │ ├─iscsiuio.socket | + | |
| - | ● │ │ ├─libvirtd-ro.socket | + | |
| - | ● │ │ ├─libvirtd.socket | + | |
| - | ● │ │ ├─rpcbind.socket | + | |
| - | ● │ │ ├─sssd-kcm.socket | + | |
| - | ● │ │ ├─systemd-coredump.socket | + | |
| - | ● │ │ ├─systemd-initctl.socket | + | |
| - | ● │ │ ├─systemd-journald-dev-log.socket | + | |
| - | ● │ │ ├─systemd-journald.socket | + | |
| - | ● │ │ ├─systemd-udevd-control.socket | + | |
| - | lines 1-57 | + | |
| - | </ | + | |
| - | Les points noirs au début de chaque ligne dans la sortie ci-dessus peuvent être de trois couleurs différentes : | + | # packages drop log rotation information into this directory |
| + | include / | ||
| - | * **Vert** implique que le service, la cible ou l' | + | # system-specific logs may be also be configured here. |
| - | * **Blanc** implique le service, la cible ou l' | + | |
| - | * **Rouge** implique que le service, la cible ou l' | + | |
| - | + | ||
| - | Pour visualiser les Unités en état d' | + | |
| - | + | ||
| - | < | + | |
| - | [root@centos8 ~]# systemctl --failed | + | |
| - | 0 loaded units listed. Pass --all to see loaded but inactive units, too. | + | |
| - | To show all installed unit files use ' | + | |
| </ | </ | ||
| - | Les dépendances sont créés sous la forme de liens symboliques dans les répertoires **/ | + | Dans la première partie |
| - | < | + | * remplacer les fichiers journaux chaque semaine |
| - | [root@centos8 ~]# ls -l / | + | |
| - | total 0 | + | |
| - | lrwxrwxrwx. 1 root root 35 May 8 2020 atd.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 38 May 8 2020 auditd.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 44 Jun 3 14:02 avahi-daemon.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 39 May 8 2020 chronyd.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 37 May 8 2020 crond.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 33 Jun 3 14:02 cups.path -> / | + | |
| - | lrwxrwxrwx. 1 root root 36 Jun 3 14:02 cups.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 43 May 8 2020 dnf-makecache.timer -> / | + | |
| - | lrwxrwxrwx. 1 root root 41 May 8 2020 firewalld.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 42 May 8 2020 irqbalance.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 37 May 8 2020 kdump.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 35 Apr 19 12:07 ksm.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 40 Apr 19 12:07 ksmtuned.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 46 May 8 2020 libstoragemgmt.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 40 Apr 19 12:07 libvirtd.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 38 May 8 2020 mcelog.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 41 May 8 2020 mdmonitor.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 49 Apr 19 12:07 netcf-transaction.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 46 May 8 2020 NetworkManager.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 41 Apr 19 12:07 nfs-client.target -> / | + | |
| - | lrwxrwxrwx. 1 root root 40 May 8 2020 remote-fs.target -> / | + | |
| - | lrwxrwxrwx. 1 root root 39 Apr 19 12:07 rpcbind.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 39 May 8 2020 rsyslog.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 38 May 8 2020 smartd.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 36 May 8 2020 sshd.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 36 May 8 2020 sssd.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 37 May 8 2020 tuned.service -> / | + | |
| - | lrwxrwxrwx. 1 root root 35 May 8 2020 vdo.service -> / | + | |
| - | [root@centos8 ~]# ls -l /usr/lib/ | + | La directive **include |
| - | total 0 | + | |
| - | lrwxrwxrwx. 1 root root 15 Apr 7 12:08 dbus.service -> ../ | + | |
| - | lrwxrwxrwx. 1 root root 15 Apr 7 16:55 getty.target -> ../ | + | |
| - | lrwxrwxrwx. 1 root root 24 Oct 6 2020 plymouth-quit.service -> ../ | + | |
| - | lrwxrwxrwx. 1 root root 29 Oct 6 2020 plymouth-quit-wait.service -> ../ | + | |
| - | lrwxrwxrwx. 1 root root 33 Apr 7 16:55 systemd-ask-password-wall.path -> ../ | + | |
| - | lrwxrwxrwx. 1 root root 25 Apr 7 16:55 systemd-logind.service -> ../ | + | |
| - | lrwxrwxrwx. 1 root root 39 Apr 7 16:55 systemd-update-utmp-runlevel.service -> ../ | + | |
| - | lrwxrwxrwx. 1 root root 32 Apr 7 16:55 systemd-user-sessions.service -> ../ | + | |
| - | </ | + | |
| - | ===4.2 - La Cible par Défaut=== | + | La deuxième partie du fichier concerne des configurations spécifiques pour certains fichiers journaux. |
| - | ==Consulter | + | <WRAP center round important 60%> |
| + | **Important** : Notez que la compression des fichiers de journalisation n'est pas activée | ||
| + | </ | ||
| - | Pour consulter la cible par défaut, il convient d' | + | Les options de la commande |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | multi-user.target | + | Usage: logrotate [OPTION...] |
| - | </code> | + | -d, --debug |
| + | -f, --force | ||
| + | -m, --mail=command | ||
| + | -s, --state=statefile | ||
| + | --skip-state-lock | ||
| + | -v, --verbose | ||
| + | -l, --log=logfile | ||
| + | --version | ||
| - | La Cible par défaut est représentée par le lien symbolique **/ | + | Help options: |
| - | + | -?, --help | |
| - | < | + | --usage |
| - | [root@centos8 ~]# ls -l / | + | |
| - | lrwxrwxrwx. 1 root root 37 May 8 2020 / | + | |
| </ | </ | ||
| - | ==Modifier la Cible par Défaut== | + | =====LAB #5 - La Journalisation avec journald===== |
| - | Pour modifier la Cible par défaut avec une prise en compte lors du **prochain** démarrage, il convient d' | + | Sous RHEL 9, les fichiers de Syslog sont gardés pour une question de compatibilité. Cependant, tous les journaux sont d' |
| < | < | ||
| - | [root@centos8 ~]# systemctl set-default graphical.target | + | [root@redhat9 |
| - | Removed / | + | total 0 |
| - | Created symlink / | + | drwxr-s---+ 2 root systemd-journal 60 Sep 25 12:44 5a35a3eb625c45cea1d33535723e791f |
| - | [root@centos8 | + | |
| - | lrwxrwxrwx. 1 root root 40 Jun 6 08:11 / | + | |
| - | [root@centos8 ~]# systemctl set-default multi-user.target | + | |
| - | Removed / | + | |
| - | Created symlink / | + | |
| - | [root@centos8 ~]# ls -l / | + | |
| - | lrwxrwxrwx. 1 root root 41 Jun 6 08:11 /etc/systemd/ | + | |
| </ | </ | ||
| - | ==Modifier | + | A l' |
| - | Il est possible | + | La configuration |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | [root@centos8 ~]# systemctl list-units --type target | egrep " | + | # This file is part of systemd. |
| - | rescue.target | + | # |
| - | [root@centos8 ~]# runlevel | + | # systemd is free software; you can redistribute it and/or modify it under the |
| - | 3 1 | + | # terms of the GNU Lesser General Public License as published by the Free |
| - | [root@centos8 ~]# who -r | + | # Software Foundation; either version 2.1 of the License, or (at your option) |
| - | run-level 1 2021-06-15 04:22 | + | # any later version. |
| - | </code> | + | # |
| + | # Entries in this file show the compile time defaults. Local configuration | ||
| + | # should be created by either modifying this file, or by creating "drop-ins" in | ||
| + | # the journald.conf.d/ | ||
| + | # Defaults can be restored by simply deleting this file and all drop-ins. | ||
| + | # | ||
| + | # Use ' | ||
| + | # | ||
| + | # See journald.conf(5) for details. | ||
| - | < | + | [Journal] |
| - | [root@centos8 ~]# systemctl isolate multi-user | + | #Storage=auto |
| - | [root@centos8 ~]# systemctl list-units --type target | egrep " | + | #Compress=yes |
| - | multi-user.target | + | #Seal=yes |
| - | [root@centos8 ~]# runlevel | + | #SplitMode=uid |
| - | 1 3 | + | # |
| - | [root@centos8 ~]# who -r | + | #RateLimitIntervalSec=30s |
| - | run-level 3 2021-06-15 04:24 last=1 | + | # |
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | Audit= | ||
| </ | </ | ||
| - | ====LAB #5 - Gestion des Services==== | + | La valeur de la variable peut être : |
| - | ===5.1 | + | * **auto** |
| + | * **persistent** - le journal est persistant et est stocké dans le répertoire **/ | ||
| + | * **volatile** - le journal est stocké dans un fichier dynamique dans le répertoire **/ | ||
| - | Commencez par installer | + | Pour rendre |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| + | [root@redhat9 ~]# cat / | ||
| + | # 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 (at your option) | ||
| + | # any later version. | ||
| + | # | ||
| + | # Entries in this file show the compile time defaults. Local configuration | ||
| + | # should be created by either modifying this file, or by creating " | ||
| + | # the journald.conf.d/ | ||
| + | # Defaults can be restored by simply deleting this file and all drop-ins. | ||
| + | # | ||
| + | # Use ' | ||
| + | # | ||
| + | # See journald.conf(5) for details. | ||
| + | |||
| + | [Journal] | ||
| + | Storage=auto | ||
| + | # | ||
| + | #Seal=yes | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | Audit= | ||
| </ | </ | ||
| - | Pour obtenir | + | Créez |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | ● httpd.service | + | [root@redhat9 ~]# ls -l /var/log/journal/ |
| - | | + | total 0 |
| - | | + | |
| - | Docs: man: | + | |
| </ | </ | ||
| - | Dans le cas du service httpd ci-dessus, on peut constater que le statut est **disabled**. Le statut peut être une de 2 valeurs : | + | Redémarrez votre VM : |
| - | + | ||
| - | * **disabled** - le service ne démarrera pas lors du prochain démarrage du système. | + | |
| - | * **enabled** - le service démarrera lors du prochain démarrage du système. | + | |
| - | + | ||
| - | Il est possible de vérifier le statut en utilisant le commande **systemctl is-enabled** | + | |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | disabled | + | [root@redhat9 ~]# Connection to 10.0.2.101 closed by remote host. |
| + | Connection to 10.0.2.101 closed. | ||
| </ | </ | ||
| - | Pour rendre le statut **enabled**, | + | Reconnectez-vous à votre VM : |
| < | < | ||
| - | [root@centos8 | + | [trainee@redhat9 |
| - | Created symlink / | + | Password: fenestros |
| - | [root@centos8 | + | [root@redhat9 |
| - | enabled | + | total 0 |
| - | [root@centos8 | + | [root@redhat9 |
| - | ● httpd.service | + | total 0 |
| - | | + | drwxr-sr-x+ 2 root systemd-journal 53 Sep 28 15:39 5a35a3eb625c45cea1d33535723e791f |
| - | Active: inactive (dead) | + | |
| - | Docs: man:httpd.service(8) | + | |
| </ | </ | ||
| - | Dans le cas du service httpd ci-dessus, on peut maintenant constater que l' | + | Journald ne peut pas envoyer de traces à un autre ordinateur. Pour utiliser un serveur de journalisation distant il faut donc ajouter la directive |
| - | * **inactive (dead)** - le service est arrêté. | + | ====5.1 - Consultation des Journaux==== |
| - | * **active(running** | + | |
| - | * **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'état en utilisant le commande **systemctl is-active** : | + | L'utilisation de la commande **journalctl** permet la consultation des journaux |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | inactive | + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: Linux version 5.14.0-427.37.1.el9_4.x86_64 (mockbuild@x86-64-02.build.eng.rdu2.redhat.com) (gcc (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3), GNU ld version 2.35.2-43> |
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: The list of certified hardware and cloud instances for Red Hat Enterprise Linux 9 can be viewed at the Red Hat Ecosystem Catalog, https:// | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: Command line: BOOT_IMAGE=(hd0, | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/fpu: xstate_offset[2]: | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using ' | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: signal: max sigframe size: 1776 | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-provided physical RAM map: | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x0000000000100000-0x00000000bffd9fff] usable | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x00000000bffda000-0x00000000bfffffff] reserved | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x0000000100000000-0x000000023fffffff] usable | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: NX (Execute Disable) protection: | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: SMBIOS 2.8 present. | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/ | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: Hypervisor detected: KVM | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: kvm-clock: Using msrs 4b564d01 and 4b564d00 | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: kvm-clock: using sched offset of 269552729537899 cycles | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: clocksource: | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: tsc: Detected 2099.998 MHz processor | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: e820: update [mem 0x00000000-0x00000fff] usable ==> reserved | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: e820: remove [mem 0x000a0000-0x000fffff] usable | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: last_pfn = 0x240000 max_arch_pfn = 0x400000000 | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: MTRR map: 4 entries (3 fixed + 1 variable; max 19), built from 8 variable MTRRs | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/PAT: Configuration [0-7]: WB WC UC- UC WB WP UC- WT | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: last_pfn = 0xbffda max_arch_pfn = 0x400000000 | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: found SMP MP-table at [mem 0x000f5bc0-0x000f5bcf] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: Using GB pages for direct mapping | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: RAMDISK: [mem 0x3149c000-0x34a45fff] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Early table checksum verification disabled | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: RSDP 0x00000000000F5980 000014 (v00 BOCHS ) | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: RSDT 0x00000000BFFE300C 000038 (v01 BOCHS BXPC | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: FACP 0x00000000BFFE2DDE 000074 (v01 BOCHS BXPC | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: DSDT 0x00000000BFFDF040 003D9E (v01 BOCHS BXPC | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: FACS 0x00000000BFFDF000 000040 | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: APIC 0x00000000BFFE2E52 000090 (v01 BOCHS BXPC | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: SSDT 0x00000000BFFE2EE2 0000CA (v01 BOCHS VMGENID | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: HPET 0x00000000BFFE2FAC 000038 (v01 BOCHS BXPC | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: WAET 0x00000000BFFE2FE4 000028 (v01 BOCHS BXPC | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving FACP table memory at [mem 0xbffe2dde-0xbffe2e51] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving DSDT table memory at [mem 0xbffdf040-0xbffe2ddd] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving FACS table memory at [mem 0xbffdf000-0xbffdf03f] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving APIC table memory at [mem 0xbffe2e52-0xbffe2ee1] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving SSDT table memory at [mem 0xbffe2ee2-0xbffe2fab] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving HPET table memory at [mem 0xbffe2fac-0xbffe2fe3] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving WAET table memory at [mem 0xbffe2fe4-0xbffe300b] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: No NUMA configuration found | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: Faking a node at [mem 0x0000000000000000-0x000000023fffffff] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: NODE_DATA(0) allocated [mem 0x23ffd5000-0x23fffffff] | ||
| + | lines 1-55 | ||
| </ | </ | ||
| - | Pour rendre l' | + | <WRAP center round important 60%> |
| + | **Important** : Notez que les messages importants sont en gras, par exemple les messages de niveaux **notice** ou **warning** et que les messages graves sont en rouge. | ||
| + | </ | ||
| - | < | + | ====5.2 - Consultation des Journaux d'une Application Spécifique==== |
| - | [root@centos8 ~]# systemctl start httpd.service | + | |
| - | </ | + | |
| - | Vérifiez ensuite | + | Pour consulter les entrées concernant une application spécifique, |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | active | + | Sep 28 15:37:18 redhat9.ittraining.loc crond[1138]: |
| + | Sep 28 15:37:18 redhat9.ittraining.loc crond[1138]: | ||
| + | Sep 28 15:37:18 redhat9.ittraining.loc crond[1138]: | ||
| + | Sep 28 15:37:18 redhat9.ittraining.loc crond[1138]: | ||
| + | </ | ||
| - | [root@centos8 ~]# systemctl status httpd.service | + | <WRAP center round important 60%> |
| - | ● httpd.service - The Apache HTTP Server | + | **Important** |
| - | Loaded: loaded (/ | + | </WRAP> |
| - | | + | |
| - | Docs: man: | + | |
| - | Main PID: 34382 (httpd) | + | |
| - | | + | |
| - | Tasks: 213 (limit: 23719) | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | ├─34384 | + | |
| - | | + | |
| - | | + | |
| - | Jun 06 15:33:05 centos8.ittraining.loc systemd[1]: Starting The Apache HTTP Server... | + | ====5.3 - Consultation des Journaux depuis le Dernier Démarrage==== |
| - | Jun 06 15:33:06 centos8.ittraining.loc systemd[1]: Started The Apache HTTP Server. | + | |
| - | Jun 06 15:33:06 centos8.ittraining.loc httpd[34382]: | + | |
| - | </ | + | |
| - | Pour arrêter une Unité de service, utilisez | + | Pour consulter les entrées depuis le dernier démarrage, il suffit d' |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | [root@centos8 ~]# systemctl status httpd.service | + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: Linux version 5.14.0-427.37.1.el9_4.x86_64 (mockbuild@x86-64-02.build.eng.rdu2.redhat.com) (gcc (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3), GNU ld version 2.35.2-43. |
| - | ● httpd.service | + | el9) #1 SMP PREEMPT_DYNAMIC Fri Sep 13 12:41:50 EDT 2024 |
| - | Loaded: loaded | + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: |
| - | Active: inactive (dead) since Sun 2021-06-06 23:58:04 EDT; 8s ago | + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: Command line: BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.14.0-427.37.1.el9_4.x86_64 root=/dev/mapper/rhel-root ro crashkernel=1G-4G: |
| - | Docs: man:httpd.service(8) | + | apper/ |
| - | | + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' |
| - | Main PID: 34382 (code=exited, status=0/SUCCESS) | + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' |
| - | Status: " | + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' |
| - | + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/fpu: xstate_offset[2]: | |
| - | Jun 06 15:33:05 centos8.ittraining.loc | + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using ' |
| - | Jun 06 15:33:06 centos8.ittraining.loc | + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: signal: max sigframe size: 1776 |
| - | Jun 06 15:33:06 centos8.ittraining.loc | + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-provided physical RAM map: |
| - | Jun 06 23:58:02 centos8.ittraining.loc | + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable |
| - | Jun 06 23:58:04 centos8.ittraining.loc | + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved |
| - | Jun 06 23:58:04 centos8.ittraining.loc | + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved |
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x0000000000100000-0x00000000bffd9fff] usable | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x00000000bffda000-0x00000000bfffffff] reserved | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x0000000100000000-0x000000023fffffff] usable | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: NX (Execute Disable) protection: active | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: SMBIOS 2.8 present. | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/01/2014 | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: Hypervisor detected: KVM | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: kvm-clock: Using msrs 4b564d01 and 4b564d00 | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: kvm-clock: using sched offset of 269552729537899 cycles | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: clocksource: | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: tsc: Detected 2099.998 MHz processor | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: e820: remove [mem 0x000a0000-0x000fffff] usable | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: last_pfn = 0x240000 max_arch_pfn = 0x400000000 | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/PAT: Configuration [0-7]: WB WC UC- UC WB WP UC- WT | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: last_pfn = 0xbffda max_arch_pfn = 0x400000000 | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: Using GB pages for direct mapping | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Early table checksum verification disabled | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: RSDP 0x00000000000F5980 000014 (v00 BOCHS ) | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: FACP 0x00000000BFFE2DDE 000074 (v01 BOCHS BXPC | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: DSDT 0x00000000BFFDF040 003D9E (v01 BOCHS BXPC | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: FACS 0x00000000BFFDF000 000040 | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: APIC 0x00000000BFFE2E52 000090 (v01 BOCHS BXPC | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: SSDT 0x00000000BFFE2EE2 0000CA (v01 BOCHS VMGENID | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: HPET 0x00000000BFFE2FAC 000038 (v01 BOCHS BXPC | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: WAET 0x00000000BFFE2FE4 000028 (v01 BOCHS BXPC | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving FACP table memory at [mem 0xbffe2dde-0xbffe2e51] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving DSDT table memory at [mem 0xbffdf040-0xbffe2ddd] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving FACS table memory at [mem 0xbffdf000-0xbffdf03f] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving SSDT table memory at [mem 0xbffe2ee2-0xbffe2fab] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving HPET table memory at [mem 0xbffe2fac-0xbffe2fe3] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving WAET table memory at [mem 0xbffe2fe4-0xbffe300b] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: No NUMA configuration found | ||
| + | --More-- | ||
| + | [q] | ||
| </ | </ | ||
| - | Pour désactiver un service au prochain démarrage du système, utilisez l'option | + | <WRAP center round important 60%> |
| + | **Important** : Notez que vous pouvez consulter les messages des démarrages précédents, il est possible d'utiliser les options | ||
| + | </ | ||
| - | < | + | ====5.4 - Consultation des Journaux d'une Priorité Spécifique==== |
| - | [root@centos8 ~]# systemctl disable httpd.service | + | |
| - | Removed / | + | |
| - | [root@centos8 ~]# systemctl status httpd.service | + | |
| - | ● httpd.service - The Apache HTTP Server | + | |
| - | | + | |
| - | | + | |
| - | Docs: man: | + | |
| - | Jun 06 15:33:05 centos8.ittraining.loc systemd[1]: Starting The Apache HTTP Server... | + | Pour consulter les entrées à partir d'une priorité spécifique et supérieur, il suffit |
| - | Jun 06 15:33:06 centos8.ittraining.loc systemd[1]: Started The Apache HTTP Server. | + | |
| - | Jun 06 15:33:06 centos8.ittraining.loc httpd[34382]: | + | |
| - | Jun 06 23:58:02 centos8.ittraining.loc systemd[1]: Stopping The Apache HTTP Server... | + | |
| - | Jun 06 23:58:04 centos8.ittraining.loc systemd[1]: httpd.service: | + | |
| - | Jun 06 23:58:04 centos8.ittraining.loc systemd[1]: Stopped The Apache HTTP Server. | + | |
| - | </ | + | |
| - | + | ||
| - | ===5.2 - Gestion | + | |
| - | + | ||
| - | Systemd permet | + | |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | # This is a template | + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: |
| - | # See httpd@.service(8) for more information. | + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: acpi PNP0A03:00: fail to add MMCONFIG information, |
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: device-mapper: | ||
| + | Sep 28 15:37:00 redhat9.ittraining.loc systemd[1]: sys-module-fuse.device: | ||
| + | Sep 28 15:37:00 redhat9.ittraining.loc kernel: sd 0:0:0:0: Power-on or device reset occurred | ||
| + | Sep 28 15:37:10 redhat9.ittraining.loc lvm[696]: PV /dev/sda2 online, VG rhel is complete. | ||
| + | Sep 28 15:37:12 redhat9.ittraining.loc avahi-daemon[752]: | ||
| + | Sep 28 15:37:16 redhat9.ittraining.loc kernel: Warning: Unmaintained driver is detected: ip_set | ||
| + | Sep 28 15:37:20 redhat9.ittraining.loc kernel: block dm-0: the capability attribute has been deprecated. | ||
| + | Sep 28 15:37:23 redhat9.ittraining.loc | ||
| + | Sep 28 15:37:23 redhat9.ittraining.loc | ||
| + | Sep 28 15:37:23 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:23 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:23 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:23 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:23 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:23 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:23 redhat9.ittraining.loc org.gnome.Shell.desktop[1802]: | ||
| + | Sep 28 15:37:23 redhat9.ittraining.loc org.gnome.Shell.desktop[1802]: | ||
| + | Sep 28 15:37:25 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:25 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:27 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:27 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:27 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:27 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:28 redhat9.ittraining.loc wireplumber[1859]: | ||
| + | Sep 28 15:37:28 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:28 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:28 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:28 redhat9.ittraining.loc wireplumber[1859]: | ||
| + | Sep 28 15:37:28 redhat9.ittraining.loc gnome-shell[1802]: | ||
| + | Sep 28 15:37:28 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:28 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:28 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:28 redhat9.ittraining.loc gsd-sharing[1908]: | ||
| + | Sep 28 15:37:28 redhat9.ittraining.loc gsd-sharing[1908]: | ||
| + | Sep 28 15:37:28 redhat9.ittraining.loc gsd-sharing[1908]: | ||
| + | Sep 28 15:37:28 redhat9.ittraining.loc org.gnome.Shell.desktop[1831]: | ||
| + | Sep 28 15:37:28 redhat9.ittraining.loc gnome-shell[1802]: | ||
| + | Sep 28 15:37:29 redhat9.ittraining.loc dbus-broker[751]: | ||
| + | Sep 28 15:37:29 redhat9.ittraining.loc dbus-broker[751]: | ||
| + | Sep 28 15:37:29 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:30 redhat9.ittraining.loc gnome-shell[1802]: | ||
| + | Sep 28 15:37:30 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:30 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:30 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:30 redhat9.ittraining.loc gsd-media-keys[1923]: | ||
| + | Sep 28 15:37:30 redhat9.ittraining.loc gsd-media-keys[1923]: | ||
| + | Sep 28 15:37:30 redhat9.ittraining.loc org.gnome.Shell.desktop[2153]: | ||
| + | Sep 28 15:37:30 redhat9.ittraining.loc org.gnome.Shell.desktop[2153]: | ||
| + | Sep 28 15:37:30 redhat9.ittraining.loc org.gnome.Shell.desktop[2153]: | ||
| + | Sep 28 15:37:30 redhat9.ittraining.loc org.gnome.Shell.desktop[2153]: | ||
| + | Sep 28 15:37:30 redhat9.ittraining.loc / | ||
| + | Sep 28 15:37:30 redhat9.ittraining.loc / | ||
| + | Sep 28 15:39:43 redhat9.ittraining.loc / | ||
| + | lines 1-55 | ||
| + | </ | ||
| - | [Unit] | + | Les priorités reconnues par Journald sont : |
| - | Description=The Apache HTTP Server | + | |
| - | After=network.target remote-fs.target nss-lookup.target | + | |
| - | Documentation=man:httpd@.service(8) | + | |
| - | [Service] | + | ^ Niveau ^ Priorité ^ Description ^ |
| - | Type=notify | + | | 0 | emerg | Système inutilisable | |
| - | Environment=LANG=C | + | | 1 | alert | Action immédiate requise | |
| - | Environment=HTTPD_INSTANCE=%i | + | | 2 | crit | Condition critique atteinte | |
| - | ExecStartPre=/ | + | | 3 | err | Erreurs rencontrées | |
| - | ExecStartPre=/ | + | | 4 | warning | Avertissements présentés | |
| - | ExecStart=/ | + | | 5 | notice | Condition normale |
| - | ExecReload=/ | + | | 6 | info | Condition normale |
| - | # Send SIGWINCH for graceful stop | + | | 7 | debug | Condition normale |
| - | KillSignal=SIGWINCH | + | |
| - | KillMode=mixed | + | |
| - | PrivateTmp=true | + | |
| - | [Install] | + | ====5.5 - Consultation des Journaux d'une Plage de Dates ou d' |
| - | WantedBy=multi-user.target | + | |
| - | </ | + | |
| - | Une instance créée à partir | + | Pour consulter les entrées d'une plage de dates ou d' |
| < | < | ||
| - | httpd@< | + | [root@redhat9 ~]# journalctl --since 03:45 --until now |
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: Linux version 5.14.0-427.37.1.el9_4.x86_64 (mockbuild@x86-64-02.build.eng.rdu2.redhat.com) (gcc (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3), GNU ld version 2.35.2-43> | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: The list of certified hardware and cloud instances for Red Hat Enterprise Linux 9 can be viewed at the Red Hat Ecosystem Catalog, https:// | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: Command line: BOOT_IMAGE=(hd0, | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/fpu: xstate_offset[2]: | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using ' | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: signal: max sigframe size: 1776 | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-provided physical RAM map: | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x0000000000100000-0x00000000bffd9fff] usable | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x00000000bffda000-0x00000000bfffffff] reserved | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: BIOS-e820: [mem 0x0000000100000000-0x000000023fffffff] usable | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: NX (Execute Disable) protection: active | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: SMBIOS 2.8 present. | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/ | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: Hypervisor detected: KVM | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: kvm-clock: Using msrs 4b564d01 and 4b564d00 | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: kvm-clock: using sched offset of 269552729537899 cycles | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: clocksource: | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: tsc: Detected 2099.998 MHz processor | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: e820: update [mem 0x00000000-0x00000fff] usable ==> reserved | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: e820: remove [mem 0x000a0000-0x000fffff] usable | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: last_pfn = 0x240000 max_arch_pfn = 0x400000000 | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: MTRR map: 4 entries (3 fixed + 1 variable; max 19), built from 8 variable MTRRs | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: x86/PAT: Configuration [0-7]: WB WC UC- UC WB WP UC- WT | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: last_pfn = 0xbffda max_arch_pfn = 0x400000000 | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: found SMP MP-table at [mem 0x000f5bc0-0x000f5bcf] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: Using GB pages for direct mapping | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: RAMDISK: [mem 0x3149c000-0x34a45fff] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Early table checksum verification disabled | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: RSDP 0x00000000000F5980 000014 (v00 BOCHS ) | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: RSDT 0x00000000BFFE300C 000038 (v01 BOCHS BXPC | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: FACP 0x00000000BFFE2DDE 000074 (v01 BOCHS BXPC | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: DSDT 0x00000000BFFDF040 003D9E (v01 BOCHS BXPC | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: FACS 0x00000000BFFDF000 000040 | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: APIC 0x00000000BFFE2E52 000090 (v01 BOCHS BXPC | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: SSDT 0x00000000BFFE2EE2 0000CA (v01 BOCHS VMGENID | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: HPET 0x00000000BFFE2FAC 000038 (v01 BOCHS BXPC | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: WAET 0x00000000BFFE2FE4 000028 (v01 BOCHS BXPC | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving FACP table memory at [mem 0xbffe2dde-0xbffe2e51] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving DSDT table memory at [mem 0xbffdf040-0xbffe2ddd] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving FACS table memory at [mem 0xbffdf000-0xbffdf03f] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving APIC table memory at [mem 0xbffe2e52-0xbffe2ee1] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving SSDT table memory at [mem 0xbffe2ee2-0xbffe2fab] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving HPET table memory at [mem 0xbffe2fac-0xbffe2fe3] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: ACPI: Reserving WAET table memory at [mem 0xbffe2fe4-0xbffe300b] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: No NUMA configuration found | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: Faking a node at [mem 0x0000000000000000-0x000000023fffffff] | ||
| + | Sep 28 15:36:59 redhat9.ittraining.loc kernel: NODE_DATA(0) allocated [mem 0x23ffd5000-0x23fffffff] | ||
| + | lines 1-55 | ||
| </ | </ | ||
| - | Dans ce fichier on peut constater l' | + | <WRAP center round important 60%> |
| + | **Important** : Il est possible | ||
| + | </ | ||
| - | * %n : est remplacé par le nom complet échappé de l' | + | ====5.6 - Consultation des Journaux en Live==== |
| - | * %N : est remplacé par le nom complet non-échappé de l' | + | |
| - | * %p : est remplacé par le préfixe échappé de l' | + | |
| - | * %P : est remplacé par le préfixe non-échappé de l' | + | |
| - | * %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' | + | |
| - | * %U : est remplacé par l'UID de l' | + | |
| - | * %H : est remplacé par le nom d' | + | |
| - | * %% : est remplacé" | + | |
| - | Créez maintenant deux copies du fichier | + | Pour consulter les journaux en live, il suffit d' |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | [root@centos8 ~]# cp /usr/lib/systemd/ | + | Sep 28 15:41:02 redhat9.ittraining.loc |
| + | Sep 28 15:41:03 redhat9.ittraining.loc | ||
| + | Sep 28 15:42:29 redhat9.ittraining.loc PackageKit[1886]: daemon quit | ||
| + | Sep 28 15:42:29 redhat9.ittraining.loc | ||
| + | Sep 28 15:43:02 redhat9.ittraining.loc | ||
| + | Sep 28 15:43:02 redhat9.ittraining.loc systemd[1340]: | ||
| + | Sep 28 15:43:02 redhat9.ittraining.loc systemd[1340]: | ||
| + | Sep 28 15:44:02 redhat9.ittraining.loc systemd[2200]: | ||
| + | Sep 28 15:44:02 redhat9.ittraining.loc systemd[2200]: | ||
| + | Sep 28 15:44:02 redhat9.ittraining.loc systemd[2200]: | ||
| + | ^C | ||
| </ | </ | ||
| - | Créez deux copies du fichier | + | ====5.7 - Consultation des Journaux avec des Mots Clefs=== |
| + | |||
| + | Pour consulter les mots clefs compris par Journald, tapez la commande | ||
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | [root@centos8 ~]# cp / | + | _AUDIT_LOGINUID= |
| + | _AUDIT_SESSION= | ||
| + | AVAILABLE= | ||
| + | AVAILABLE_PRETTY= | ||
| + | _BOOT_ID= | ||
| + | _CAP_EFFECTIVE= | ||
| + | _CMDLINE= | ||
| + | CODE_FILE= | ||
| + | CODE_FUNC= | ||
| + | CODE_LINE= | ||
| + | _COMM= | ||
| + | CURRENT_USE= | ||
| + | CURRENT_USE_PRETTY= | ||
| + | DBUS_BROKER_LOG_DROPPED= | ||
| + | DBUS_BROKER_MESSAGE_DESTINATION= | ||
| + | DBUS_BROKER_MESSAGE_INTERFACE= | ||
| + | DBUS_BROKER_MESSAGE_MEMBER= | ||
| + | DBUS_BROKER_MESSAGE_PATH= | ||
| + | DBUS_BROKER_MESSAGE_SERIAL= | ||
| + | DBUS_BROKER_MESSAGE_SIGNATURE= | ||
| </ | </ | ||
| - | Editez | + | Pour voir la liste des processus dont les traces sont inclus dans les journaux |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | [root@centos8 | + | 0 |
| - | # | + | |
| - | # This is the main Apache HTTP server configuration file. It contains the | + | [root@redhat9 |
| - | # configuration directives that give the server its instructions. | + | accounts-daemon |
| - | # See < | + | at-spi2-registr |
| - | # In particular, see | + | auditctl |
| - | # < | + | auditd |
| - | # for a discussion of each configuration directive. | + | augenrules |
| - | # | + | </code> |
| - | # See the httpd.conf(5) man page for more information on this configuration, | + | |
| - | # and httpd.service(8) on using and configuring the httpd service. | + | |
| - | # | + | |
| - | # Do NOT simply read the instructions in here without understanding | + | |
| - | # what they do. They' | + | |
| - | # consult the online docs. You have been warned. | + | |
| - | # | + | |
| - | # Configuration and logfile names: If the filenames you specify for many | + | |
| - | # of the server' | + | |
| - | # server will use that explicit path. If the filenames do *not* begin | + | |
| - | # with "/", | + | |
| - | # with ServerRoot set to '/www' will be interpreted by the | + | |
| - | # server as '/ | + | |
| - | # interpreted as '/ | + | |
| - | # | + | =====LAB |
| - | # ServerRoot: The top of the directory tree under which the server's | + | |
| - | # configuration, | + | |
| - | # | + | |
| - | # Do not add a slash at the end of the directory path. If you point | + | |
| - | # ServerRoot at a non-local disk, be sure to specify a local disk on the | + | |
| - | # Mutex directive, if file-based mutexes are used. If you wish to share the | + | |
| - | # same ServerRoot for multiple httpd daemons, you will need to change at | + | |
| - | # least PidFile. | + | |
| - | # | + | |
| - | ServerRoot "/ | + | |
| - | # | + | ====6.1 - Introduction==== |
| - | # Listen: Allows you to bind Apache to specific IP addresses and/or | + | |
| - | # ports, instead of the default. See also the < | + | |
| - | # directive. | + | |
| - | # | + | |
| - | # Change this to Listen on specific IP addresses as shown below to | + | |
| - | # prevent Apache from glomming onto all bound IP addresses. | + | |
| - | # | + | |
| - | #Listen 12.34.56.78: | + | |
| - | Listen 8008 | + | |
| - | PidFile / | + | |
| - | # | + | Dans le cas d'un serveur de réseau, il est souvent important de maintenir l' |
| - | # Dynamic Shared Object (DSO) Support | + | |
| - | # | + | |
| - | # To be able to use the functionality of a module which was built as a DSO you | + | |
| - | # have to place corresponding `LoadModule' | + | |
| - | # directives contained in it are actually available _before_ they are used. | + | |
| - | # Statically compiled modules (those listed by `httpd -l') do not need | + | |
| - | # to be loaded here. | + | |
| - | # | + | |
| - | # Example: | + | |
| - | # LoadModule foo_module modules/ | + | |
| - | --More--(19%) | + | |
| - | </ | + | |
| - | Editez la directive | + | Le protocole utilisé s' |
| - | <code> | + | <WRAP center round important> |
| - | [root@centos8 ~]# vi / | + | **Important** - La commande **ntpdate**, |
| - | [root@centos8 ~]# more / | + | </WRAP> |
| - | # | + | |
| - | # This is the main Apache HTTP server configuration file. It contains the | + | |
| - | # configuration directives that give the server its instructions. | + | |
| - | # See < | + | |
| - | # In particular, see | + | |
| - | # < | + | |
| - | # for a discussion of each configuration directive. | + | |
| - | # | + | |
| - | # See the httpd.conf(5) man page for more information on this configuration, | + | |
| - | # and httpd.service(8) on using and configuring the httpd service. | + | |
| - | # | + | |
| - | # Do NOT simply read the instructions in here without understanding | + | |
| - | # what they do. They're here only as hints or reminders. | + | |
| - | # consult the online docs. You have been warned. | + | |
| - | # | + | |
| - | # Configuration and logfile names: If the filenames you specify for many | + | |
| - | # of the server' | + | |
| - | # server will use that explicit path. If the filenames do *not* begin | + | |
| - | # with "/", the value of ServerRoot is prepended -- so ' | + | |
| - | # with ServerRoot set to '/ | + | |
| - | # server as '/ | + | |
| - | # interpreted as '/ | + | |
| - | # | + | Linux utilise le fuseau d'horaire **UTC** (// |
| - | # ServerRoot: The top of the directory tree under which the server's | + | |
| - | # configuration, | + | |
| - | # | + | |
| - | # Do not add a slash at the end of the directory path. If you point | + | |
| - | # ServerRoot at a non-local disk, be sure to specify a local disk on the | + | |
| - | # Mutex directive, if file-based mutexes are used. If you wish to share the | + | |
| - | # same ServerRoot for multiple httpd daemons, you will need to change at | + | |
| - | # least PidFile. | + | |
| - | # | + | |
| - | ServerRoot "/etc/httpd" | + | |
| - | # | + | <code> |
| - | # Listen: Allows you to bind Apache to specific IP addresses and/or | + | [root@redhat9 ~]# ls -l / |
| - | # ports, instead of the default. See also the <VirtualHost> | + | lrwxrwxrwx. 1 root root 34 Oct 19 2023 / |
| - | # directive. | + | |
| - | # | + | |
| - | # Change this to Listen on specific IP addresses as shown below to | + | |
| - | # prevent Apache from glomming onto all bound IP addresses. | + | |
| - | # | + | |
| - | #Listen 12.34.56.78:80 | + | |
| - | Listen 8009 | + | |
| - | PidFile | + | |
| - | # | + | |
| - | # Dynamic Shared Object (DSO) Support | + | |
| - | # | + | |
| - | # To be able to use the functionality of a module which was built as a DSO you | + | |
| - | # have to place corresponding `LoadModule' | + | |
| - | # directives contained in it are actually available _before_ they are used. | + | |
| - | # Statically compiled modules (those listed by `httpd -l') do not need | + | |
| - | # to be loaded here. | + | |
| - | # | + | |
| - | # Example: | + | |
| - | # LoadModule foo_module modules/mod_foo.so | + | |
| - | --More--(19%) | + | |
| </ | </ | ||
| - | Démarrez les deux services | + | Ce fichier peut être un fichier ordinaire ou bien un lien symbolique pointant vers un de sfichiers dans le répertoire **/ |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | [root@centos8 ~]# systemctl status httpd@instance01.service | + | Africa |
| - | ● httpd@instance01.service - The Apache HTTP Server | + | America |
| - | | + | Antarctica |
| - | Active: active (running) since Mon 2021-06-07 01:40:43 EDT; 7s ago | + | Arctic |
| - | Docs: man: | + | </code> |
| - | Process: 43854 ExecStartPre=/ | + | |
| - | Process: 43852 ExecStartPre=/ | + | |
| - | Main PID: 43856 (httpd) | + | |
| - | | + | |
| - | Tasks: 213 (limit: 23719) | + | |
| - | | + | |
| - | CGroup: / | + | |
| - | | + | |
| - | ├─43857 / | + | |
| - | ├─43858 / | + | |
| - | | + | |
| - | └─43860 | + | |
| - | Jun 07 01:40:43 centos8.ittraining.loc systemd[1]: Starting The Apache HTTP Server... | + | Pour connaître le fuseau d' |
| - | Jun 07 01:40:43 centos8.ittraining.loc systemd[1]: Started The Apache HTTP Server. | + | |
| - | Jun 07 01:40:43 centos8.ittraining.loc httpd[43856]: | + | |
| - | [root@centos8 ~]# systemctl start httpd@instance02.service | + | |
| - | [root@centos8 ~]# systemctl status httpd@instance02.service | + | |
| - | ● httpd@instance02.service - The Apache HTTP Server | + | |
| - | | + | |
| - | | + | |
| - | Docs: man: | + | |
| - | Process: 43568 ExecStartPre=/ | + | |
| - | Process: 43566 ExecStartPre=/ | + | |
| - | Main PID: 43569 (httpd) | + | |
| - | | + | |
| - | Tasks: 213 (limit: 23719) | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | Jun 07 01:36:45 centos8.ittraining.loc systemd[1]: Starting The Apache HTTP Server... | + | < |
| - | Jun 07 01:36:45 centos8.ittraining.loc systemd[1]: Started The Apache HTTP Server. | + | [root@redhat9 ~]# date |
| - | Jun 07 01:36:45 centos8.ittraining.loc httpd[43569]: Server configured, listening on: port 8009 | + | Sat Sep 28 03:55:32 PM CEST 2024 |
| </ | </ | ||
| - | ===5.3 | + | <WRAP center round important> |
| + | **Important** | ||
| + | </ | ||
| - | Il est possible | + | Le fuseau |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | ● httpd.service | + | Local time: Sat 2024-09-28 15:57:01 CEST |
| - | Loaded: loaded (/ | + | Universal time: Sat 2024-09-28 13:57:01 UTC |
| - | Active: inactive | + | RTC time: Sat 2024-09-28 13:57:01 |
| - | Docs: man:httpd.service(8) | + | Time zone: Europe/ |
| + | System clock synchronized: no | ||
| + | NTP service: inactive | ||
| + | RTC in local TZ: no | ||
| + | </ | ||
| - | Jun 07 18:27:25 centos8.ittraining.loc httpd[58535]: | + | La commande **timedatectl** peut être utilisée pour modifier le fuseau d' |
| - | Jun 07 18:27:29 centos8.ittraining.loc systemd[1]: Stopping The Apache HTTP Server... | + | |
| - | Jun 07 18:27:30 centos8.ittraining.loc systemd[1]: httpd.service: | + | |
| - | Jun 07 18:27:30 centos8.ittraining.loc systemd[1]: Stopped The Apache HTTP Server. | + | |
| - | Jun 07 18:27:32 centos8.ittraining.loc systemd[1]: Starting The Apache HTTP Server... | + | |
| - | Jun 07 18:27:32 centos8.ittraining.loc systemd[1]: Started The Apache HTTP Server. | + | |
| - | Jun 07 18:27:32 centos8.ittraining.loc httpd[58760]: | + | |
| - | Jun 07 18:27:34 centos8.ittraining.loc systemd[1]: Stopping The Apache HTTP Server... | + | |
| - | Jun 07 18:27:36 centos8.ittraining.loc systemd[1]: httpd.service: | + | |
| - | Jun 07 18:27:36 centos8.ittraining.loc systemd[1]: Stopped The Apache HTTP Server. | + | |
| - | [root@centos8 | + | < |
| - | Created symlink / | + | [root@redhat9 |
| - | [root@centos8 | + | [root@redhat9 |
| - | Failed to enable unit: Unit file /etc/ | + | Local time: Sat 2024-09-28 07:05:43 MST |
| + | | ||
| + | RTC time: Sat 2024-09-28 14:05:43 | ||
| + | Time zone: America/Phoenix (MST, -0700) | ||
| + | System clock synchronized: | ||
| + | NTP service: inactive | ||
| + | RTC in local TZ: no | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | Failed to start httpd.service: Unit httpd.service | + | [root@redhat9 ~]# timedatectl |
| + | Local time: Sat 2024-09-28 16:06:35 CEST | ||
| + | | ||
| + | RTC time: Sat 2024-09-28 14:06:35 | ||
| + | Time zone: Europe/ | ||
| + | System clock synchronized: | ||
| + | NTP service: inactive | ||
| + | RTC in local TZ: no | ||
| </ | </ | ||
| - | Pour autoriser | + | L' |
| + | |||
| + | Vous pouvez aussi modifier le fuseau | ||
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | Removed / | + | Please identify a location so that time zone rules can be set correctly. |
| + | Please select a continent, ocean, " | ||
| + | 1) Africa | ||
| + | 2) Americas | ||
| + | 3) Antarctica | ||
| + | 4) Asia 8) Indian Ocean | ||
| + | #? ^C | ||
| + | </ | ||
| - | [root@centos8 ~]# systemctl enable httpd.service | + | Il est est possible de modifier le fuseau d' |
| - | Created symlink / | + | |
| - | [root@centos8 | + | < |
| - | + | [root@redhat9 | |
| - | [root@centos8 | + | Sat Sep 28 03:59:46 PM CEST 2024 |
| - | ● httpd.service - The Apache HTTP Server | + | [root@redhat9 |
| - | | + | [root@redhat9 ~]# date |
| - | Active: active (running) since Mon 2021-06-07 18:30:59 EDT; 5s ago | + | Sat Sep 28 02:59:54 PM BST 2024 |
| - | Docs: man: | + | [root@redhat9 ~]# export TZ=:/usr/share/zoneinfo/Europe/Paris |
| - | Main PID: 59101 (httpd) | + | [root@redhat9 ~]# date |
| - | | + | Sat Sep 28 04:00:06 PM CEST 2024 |
| - | Tasks: 213 (limit: 23719) | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | ├─59103 / | + | |
| - | | + | |
| - | | + | |
| - | + | ||
| - | Jun 07 18:30:59 centos8.ittraining.loc systemd[1]: Starting The Apache HTTP Server... | + | |
| - | Jun 07 18:30:59 centos8.ittraining.loc systemd[1]: Started The Apache HTTP Server. | + | |
| - | Jun 07 18:31:00 centos8.ittraining.loc httpd[59101]: Server configured, listening on: port 80 | + | |
| </ | </ | ||
| - | =====Arrêt du Système===== | + | ====6.2 - Le Service chronyd==== |
| - | Sous RHEL / CentOS 8 les commandes **halt**, **poweroff**, | + | Sous RHEL 9, le serveur d' |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | lrwxrwxrwx. 1 root root 16 Apr 7 16:55 / | + | ○ chronyd.service |
| - | lrwxrwxrwx. 1 root root 16 Apr 7 16:55 /usr/sbin/poweroff -> ../bin/systemctl | + | Loaded: loaded (/usr/lib/systemd/system/chronyd.service; disabled; preset: enabled) |
| - | lrwxrwxrwx. 1 root root 16 Apr 7 16:55 / | + | Active: inactive (dead) |
| - | lrwxrwxrwx. 1 root root 16 Apr 7 16:55 / | + | Docs: man: |
| + | | ||
| </ | </ | ||
| - | La manière recommendée d'utiliser ces commandes est donc : | + | Pour activer ce serveur, utilisez l'option **set-ntp yes** de la commande **timedatectl** |
| - | * systemctl halt | + | < |
| - | * systemctl poweroff | + | [root@redhat9 ~]# timedatectl set-ntp yes |
| - | * systemctl reboot | + | |
| - | * systemctl shutdown | + | |
| - | Il est cependant toujours possibles d' | + | [root@redhat9 ~]# timedatectl |
| + | Local time: Sat 2024-09-28 16:53:46 CEST | ||
| + | | ||
| + | RTC time: Sat 2024-09-28 14:53:46 | ||
| + | Time zone: Europe/ | ||
| + | System clock synchronized: | ||
| + | NTP service: active | ||
| + | RTC in local TZ: no | ||
| + | </ | ||
| - | ====La Commande shutdown==== | + | Vérifiez ensuite que le service **chronyd** est démarré : |
| - | Lors de l' | + | < |
| + | [root@redhat9 ~]# systemctl status chronyd | ||
| + | ● chronyd.service - NTP client/ | ||
| + | | ||
| + | | ||
| + | Docs: man: | ||
| + | | ||
| + | Process: 2673 ExecStart=/ | ||
| + | Main PID: 2675 (chronyd) | ||
| + | Tasks: 1 (limit: 48800) | ||
| + | | ||
| + | CPU: 45ms | ||
| + | | ||
| + | | ||
| - | * Il previent les utilisateurs, | + | Sep 28 16:53:41 redhat9.ittraining.loc systemd[1]: Starting NTP client/ |
| - | * Il arrête tous les services, | + | Sep 28 16:53:41 redhat9.ittraining.loc chronyd[2675]: |
| - | * Il inscrit toutes les données sur disque, | + | Sep 28 16:53:41 redhat9.ittraining.loc chronyd[2675]: |
| - | * Il démonte les systèmes de fichiers. | + | Sep 28 16:53:41 redhat9.ittraining.loc chronyd[2675]: |
| + | Sep 28 16:53:41 redhat9.ittraining.loc chronyd[2675]: | ||
| + | Sep 28 16:53:41 redhat9.ittraining.loc systemd[1]: Started NTP client/ | ||
| + | Sep 28 16:53:46 redhat9.ittraining.loc chronyd[2675]: | ||
| + | Sep 28 16:53:46 redhat9.ittraining.loc chronyd[2675]: | ||
| + | </ | ||
| - | La commande utilisée pour arrêter le système est la commande **shutdown** : | + | La commande **chronyc** permet de voir le statut |
| - | + | ||
| - | shutdown [-t sec] [-HPrhkc] heure [message] | + | |
| - | + | ||
| - | ===Options | + | |
| - | + | ||
| - | Les options de cette commande sont : | + | |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | shutdown [OPTIONS...] [TIME] [WALL...] | + | |
| - | + | ||
| - | Shut down the system. | + | |
| - | --help Show this help | + | .-- Source mode ' |
| - | -H --halt Halt the machine | + | / .- Source state ' |
| - | -P --poweroff | + | | / ' |
| - | -r --reboot | + | || .- xxxx [ yyyy ] +/- zzzz |
| - | -h | + | || Reachability register (octal) |
| - | | + | || Log2(Polling interval) |
| - | --no-wall | + | || \ |
| - | -c | + | || |
| + | MS Name/IP address | ||
| + | =============================================================================== | ||
| + | ^* 64.ip-54-39-23.net | ||
| + | ^- rikku.vrillusions.com | ||
| + | ^- rwhois.dargalsolutions.c> | ||
| + | ^- ntp.pawdesigns.ca | ||
| </ | </ | ||
| - | L' | + | ====6.3 - Le Fichier / |
| - | ^ Valeur ^ Description ^ | + | Le service **chronyd** maintient l'horloge matérielle locale (RTC), généralement inexacte, à la bonne heure en le synchronisant avec les serveurs NTP configurés. Si aucune |
| - | | hh:mm | L' | + | calcule |
| - | | +m | Nombre de minutes avant que l' | + | |
| - | | now | L'opération | + | |
| - | <WRAP center round important 60%> | + | Les serveurs NTP configurés sont : **pool 2.rhel.pool.ntp.org iburst**. L'option **iburst** implique qu' |
| - | **Important** : Si l'opération est programmée pour dans moins de 5 minutes, les connexions supplémentaires | + | |
| - | </ | + | |
| - | L'option | + | Le protocole NTP utilise le port 123. Les serveurs de temps de racine s'appellent des serveurs de **Stratum 0**. En dessous se trouvent des serveurs |
| < | < | ||
| - | [root@centos8 | + | [root@redhat9 |
| - | Mon Jun 7 18:58:26 EDT 2021 | + | # Use public servers from the pool.ntp.org project. |
| - | Shutdown scheduled for Mon 2021-06-07 18:59:26 EDT, use ' | + | # Please consider joining the pool (https://www.pool.ntp.org/join.html). |
| - | </code> | + | pool 2.rhel.pool.ntp.org iburst |
| - | ==== La Commande reboot==== | + | # Use NTP servers from DHCP. |
| + | sourcedir / | ||
| - | Cette commande redémarre le système. | + | # Record the rate at which the system clock gains/ |
| + | driftfile / | ||
| - | ===Options de la commande=== | + | # Allow the system clock to be stepped in the first three updates |
| + | # if its offset is larger than 1 second. | ||
| + | makestep 1.0 3 | ||
| - | Les options de cette commande sont : | + | # Enable kernel synchronization of the real-time clock (RTC). |
| + | rtcsync | ||
| - | < | + | # Enable hardware timestamping on all interfaces that support it. |
| - | [root@centos8 ~]# reboot --help | + | #hwtimestamp * |
| - | reboot [OPTIONS...] [ARG] | + | |
| - | Reboot | + | # Increase the minimum number of selectable sources required to adjust |
| + | # the system | ||
| + | #minsources 2 | ||
| - | | + | # Allow NTP client access from local network. |
| - | --halt | + | #allow 192.168.0.0/16 |
| - | -p --poweroff | + | |
| - | | + | |
| - | -f --force | + | |
| - | -w --wtmp-only Don't halt/ | + | |
| - | -d --no-wtmp | + | |
| - | | + | |
| - | </code> | + | |
| - | ==== La Commande halt==== | + | # Serve time even if not synchronized to a time source. |
| + | #local stratum 10 | ||
| - | Cette commande arrête le système. | + | # Require authentication (nts or key option) for all NTP sources. |
| + | # | ||
| - | ===Options de la commande=== | + | # Specify file containing keys for NTP authentication. |
| + | keyfile / | ||
| - | Les options de cette commande sont : | + | # Save NTS keys and cookies. |
| + | ntsdumpdir / | ||
| - | < | + | # Insert/ |
| - | [root@centos8 ~]# halt --help | + | #leapsecmode slew |
| - | halt [OPTIONS...] | + | |
| - | Halt the system. | + | # Get TAI-UTC offset and leap seconds from the system |
| + | leapsectz right/UTC | ||
| - | | + | # Specify directory for log files. |
| - | --halt | + | logdir |
| - | -p --poweroff | + | |
| - | | + | # Select which information is logged. |
| - | -f --force | + | #log measurements statistics tracking |
| - | -w --wtmp-only Don't halt/power-off/ | + | |
| - | -d --no-wtmp | + | |
| - | --no-wall | + | |
| </ | </ | ||
| - | ==== La Commande poweroff==== | ||
| - | Cette commande arrête le système et coupe l' | ||
| - | |||
| - | ===Options de la commande=== | ||
| - | |||
| - | Les options de cette commande sont : | ||
| - | |||
| - | < | ||
| - | [root@centos8 ~]# poweroff --help | ||
| - | poweroff [OPTIONS...] | ||
| - | |||
| - | Power off the system. | ||
| - | |||
| - | | ||
| - | | ||
| - | -p --poweroff | ||
| - | | ||
| - | -f --force | ||
| - | -w --wtmp-only Don't halt/ | ||
| - | -d --no-wtmp | ||
| - | | ||
| - | </ | ||
| ----- | ----- | ||
| Copyright © 2024 Hugh Norris. | Copyright © 2024 Hugh Norris. | ||