Outils pour utilisateurs

Outils du site


linux:systemd (lu 81 fois)

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
linux:systemd [15-05-2017 09:23] edmc73linux:systemd [04-12-2025 22:00] (Version actuelle) edmc73
Ligne 1: Ligne 1:
 ====== SystemD ====== ====== SystemD ======
  
 +Une belle doc en français => https://lea-linux.org/documentations/systemd
  
 +
 +===== Lire les log =====
 +
 +--- source: https://www.linuxtricks.fr/wiki/utiliser-journalctl-les-logs-de-systemd
 +
 +  journalctl
 +comme tail -f
 +  journalctl -f
 +
 +Filtrer par service
 +  journalctl -u crond
 +
 +
 +===== Timer =====
 Lister les timers Lister les timers
   systemctl list-timers --all   systemctl list-timers --all
Ligne 21: Ligne 36:
 [Install] [Install]
 WantedBy=timers.target WantedBy=timers.target
-and certbot.service will execute the renew command. 
 </code> </code>
 +
 +Script venant de l'install par centos
 +<code bash>
 +[Unit]
 +Description=This is the timer to set the schedule for automated renewals
 +
 +[Timer]
 +OnCalendar=daily
 +RandomizedDelaySec=6hours
 +Persistent=true
 +
 +[Install]
 +WantedBy=timers.target
 +
 +</code>
 +
 +
 +
 +
 +and certbot.service will execute the renew command.
 +
  
 <code bash> <code bash>
Ligne 35: Ligne 70:
 PrivateTmp=true PrivateTmp=true
 </code> </code>
 +
 +Script venant de l'install par centos
 +<code bash>
 +[Unit]
 +Description=This service automatically renews any certbot certificates found
 +
 +[Service]
 +EnvironmentFile=/etc/sysconfig/certbot
 +Type=oneshot
 +ExecStart=/usr/bin/certbot renew $PRE_HOOK $POST_HOOK $RENEW_HOOK $CERTBOT_ARGS
 +</code>
 +
 +
 +Surtout de pas oublier d'activer ce timer
 +  systemctl enable certbot-renew.timer
 +  systemctl start certbot-renew.timer
 +  systemctl status certbot-renew.timer
 +
 +
 +===== Python =====
 +
 +https://alexandra-zaharia.github.io/posts/stopping-python-systemd-service-cleanly/
 +
 +Pour gérer le stop d'un script python, éviter le SIGTERM et utiliser le SIGINT (équivalent d'un Ctrl+c)
 +
 +  [Service]
 +  KillSignal=SIGINT
 +
 +
linux/systemd.1494840221.txt.gz · Dernière modification : de edmc73