Outils pour utilisateurs

Outils du site


informatique:system_admin:systemd

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
informatique:system_admin:systemd [16/11/2025 11:06] – [Timer (Cron)] cyrilleinformatique:system_admin:systemd [01/12/2025 10:15] (Version actuelle) – [Resolve] cyrille
Ligne 2: Ligne 2:
  
 Voir aussi [[/informatique/system_admin/journalctl|journalctl]] Voir aussi [[/informatique/system_admin/journalctl|journalctl]]
 +
 +  * https://systemd.io/
 +  * https://www.freedesktop.org/software/systemd/man/latest/
  
 Les directives: Les directives:
Ligne 24: Ligne 27:
 - https://blog.stephane-robert.info/docs/admin-serveurs/linux/timers/ - https://blog.stephane-robert.info/docs/admin-serveurs/linux/timers/
 - https://www.siberoloji.com/how-to-use-systemd-timers-instead-of-cron-in-debian-12-bookworm/ - https://www.siberoloji.com/how-to-use-systemd-timers-instead-of-cron-in-debian-12-bookworm/
 +
 +==== Exemple ====
 +
 +les stats de livraison d'emails avec Postfix sur handipause.fr :
 +
 +Le service ''/etc/systemd/system/mail-stats.service''
 +
 +<code>
 +#
 +# Génère des stats de delivery pour Postfix
 +#
 +# Doc:
 +# Timer: https://blog.stephane-robert.info/docs/admin-serveurs/linux/timers/
 +# Service: https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html
 +# Unit: https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html
 +#
 +[Unit]
 +Description=Génère qlqs stats Postfix
 +# A space-separated list of one or more units that are activated when this unit enters the "failed" state.
 +OnFailure=onfailure-email@%N.service
 +
 +[Service]
 +Type=oneshot
 +ExecStart=/usr/bin/php /home/debian/postfix-delivery-status/scripts/deliveryStats/deliveryStats.php /home/debian/postfix-delivery-status/conf/handipause.conf.php /var/www/html
 +# Additional commands that are executed after the service is stopped.
 +#ExecStopPost=
 +</code>
 +
 +Le timer ''/etc/systemd/system/mail-stats.timer''
 +
 +<code>
 +[Unit]
 +Description=Génère périodiquement qlqs stats Postfix
 +
 +[Timer]
 +# https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html#
 +# check format with `systemd-analyze calendar "*-*-* 00/2:00:00"`
 +OnCalendar=*-*-* 00/6:00:00
 +Persistent=true
 +
 +[Install]
 +WantedBy=timers.target
 +</code>
  
 ===== Resolve ===== ===== Resolve =====
  
 La gestion DSN par systemd. La gestion DSN par systemd.
 +
 +  * [[https://www.malekal.com/configurer-cache-dns-linux-systemd-resolved-dnsmasq-bind/|Configurer un cache DNS sur Linux avec systemd-resolved, dnsmasq ou BIND]]
 +  * https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers/
  
 <code bash> <code bash>
 sudo systemctl status systemd-resolved.service sudo systemctl status systemd-resolved.service
-sudo resolvectl statistics+ 
 +# ========== 
 + 
 +$ sudo resolvectl status 
 +Global 
 +       Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported 
 +resolv.conf mode: uplink 
 + 
 +Link 2 (ens3) 
 +    Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6 
 +         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported 
 +Current DNS Server: 2001:41d0:3:163::
 +       DNS Servers: 2001:41d0:3:163::1 213.186.33.99 
 + 
 +Link 3 (ens4) 
 +    Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6 
 +         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported 
 +Current DNS Server: 213.186.33.99 
 +       DNS Servers: 213.186.33.99 
 + 
 +# ========== 
 + 
 +sudo resolvectl statistics 
 +DNSSEC supported by current servers: no 
 + 
 +Transactions               
 +Current Transactions:
 +  Total Transactions: 2906 
 +                           
 +Cache                      
 +  Current Cache Size: 1 
 +          Cache Hits: 478 
 +        Cache Misses: 4417 
 +                           
 +DNSSEC Verdicts            
 +              Secure: 0 
 +            Insecure: 0 
 +               Bogus:
 +       Indeterminate:
 + 
 +# ========== 
 + 
 +$ sudo resolvectl query 1.1.1.1 
 +1.1.1.1: one.one.one.one                       -- link: ens3 
 +-- Information acquired via protocol DNS in 23.6ms. 
 +-- Data is authenticated: no; Data was acquired via local or encrypted transport: no 
 +-- Data from: network 
 </code> </code>
  
  
informatique/system_admin/systemd.1763287604.txt.gz · Dernière modification : de cyrille

Sauf mention contraire, le contenu de ce wiki est placé sous les termes de la licence suivante : CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki