tech:notes_systemd
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| tech:notes_systemd [2025/03/24 15:06] – créée - modification externe 127.0.0.1 | tech:notes_systemd [2026/06/29 14:04] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes SystemD | ||
| + | |||
| + | Voir : | ||
| + | * [[Systemd journalctl journal logs|journalctl]] | ||
| + | * [[redhat_acces_var_log_mariadb_mariadb.log_sans_etre_root|systemd service dépendant d'un autre service]] | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * [Durcir nginx et PHP avec systemd](https:// | ||
| + | |||
| + | [Hardening Security focused systemd configuration](https:// | ||
| + | |||
| + | Lister les services | ||
| + | ~~~bash | ||
| + | systemctl list-unit-files | ||
| + | systemctl list-units | ||
| + | ~~~ | ||
| + | |||
| + | Lister les services inactifs | ||
| + | ~~~bash | ||
| + | systemctl list-units -all --state=inactive | ||
| + | ~~~ | ||
| + | |||
| + | Lister les services KO | ||
| + | ~~~bash | ||
| + | systemctl -a | grep dead | ||
| + | ~~~ | ||
| + | |||
| + | Lister les services actifs | ||
| + | ~~~bash | ||
| + | # SystemD | ||
| + | systemctl list-units --type service --state active | ||
| + | |||
| + | # Avant SystemD | ||
| + | chkconfig --list | grep -E ' | ||
| + | ~~~ | ||
| + | |||
| + | Savoir si le service est activé ou désactivé | ||
| + | ~~~bash | ||
| + | systemctl is-active httpd | ||
| + | systemctl is-enabled httpd | ||
| + | ~~~ | ||
| + | |||
| + | Relire la conf | ||
| + | ~~~bash | ||
| + | systemctl daemon-reload | ||
| + | ~~~ | ||
| + | |||
| + | Les différents types de services | ||
| + | * http:// | ||
| + | |||
| + | |||
| + | Runlevel et Target | ||
| + | |||
| + | | **Runlevel** | **Target** | ||
| + | | ------------ | ----------------- | | ||
| + | | 0 | poweroff.target | ||
| + | | 1 | rescue.target | ||
| + | | 2, 3, 4 | multi-user.target | | ||
| + | | 5 | graphical.target | ||
| + | | 6 | reboot.target | ||
| + | |||
| + | |||
| + | ## Contrôler des services (Units) SystemD distants avec Hirte | ||
| + | |||
| + | Voir : | ||
| + | * < | ||
| + | |||
| + | Exemple | ||
| + | ~~~bash | ||
| + | hirtectl start rpi4 httpd.service | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Debug | ||
| + | |||
| + | ~~~bash | ||
| + | systemctl show --property=Environment docker | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Autres | ||
| + | |||
| + | If you don't like systemctl' | ||
| + | ~~~bash | ||
| + | export SYSTEMD_PAGER= | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Logs entre deux date | ||
| + | |||
| + | ~~~bash | ||
| + | journalctl --since " | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Disable systemd redirection | ||
| + | |||
| + | ~~~bash | ||
| + | export _SYSTEMCTL_SKIP_REDIRECT=1 | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### tmpfile | ||
| + | |||
| + | ~~~ini | ||
| + | [Service] | ||
| + | PrivateTmp=true | ||
| + | ~~~ | ||
| + | |||
| + | --- | ||
| + | |||
| + | ~~~bash | ||
| + | man -k tmpfiles | ||
| + | ~~~ | ||
| + | |||
| + | / | ||
| + | |||
| + | `/ | ||
| + | ~~~ | ||
| + | x / | ||
| + | ~~~ | ||
| + | |||
| + | ### reboot | ||
| + | |||
| + | ~~~bash | ||
| + | systemctl reboot | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Lang Locale | ||
| + | |||
| + | Voir [[notes_langue_lang_locale_temps_timezone_tz|Notes langue lang locale - SystemD]] | ||
| + | |||
| + | ~~~bash | ||
| + | # | ||
| + | timedatectl set-timezone Europe/ | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Pb | ||
| + | |||
| + | ### RemoveIPC - Quand Poettering fait des siennes | ||
| + | |||
| + | Problème si compte UID > 1000 à cause de **RemoveIPC** | ||
| + | |||
| + | https:// | ||
| + | |||
| + | RemoveIPC Directive \\ | ||
| + | A new option called RemoveIPC was introduced in RHEL 7.2 through Systemd v219. When set to yes, this option forces a cleanup of all allocated inter-process communication (IPC) resources linked to a user leaving his last session. If a daemon is running as a user with a uid number >=1000, it may crash. | ||
| + | |||
| + | This option should always be set to no by default but, due to the logic of package upgrade, it is highly advisable to set RemoveIPC=no in the / | ||
| + | |||
| + | Source : https:// | ||
| + | |||
| + | |||
