Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| linux:systemd [15-05-2017 09:23] – edmc73 | linux:systemd [04-12-2025 22:00] (Version actuelle) – edmc73 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ====== SystemD ====== | ====== SystemD ====== | ||
| + | Une belle doc en français => https:// | ||
| + | |||
| + | ===== Lire les log ===== | ||
| + | |||
| + | --- source: https:// | ||
| + | |||
| + | 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. | ||
| </ | </ | ||
| + | |||
| + | Script venant de l' | ||
| + | <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 | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | and certbot.service will execute the renew command. | ||
| + | |||
| <code bash> | <code bash> | ||
| Ligne 35: | Ligne 70: | ||
| PrivateTmp=true | PrivateTmp=true | ||
| </ | </ | ||
| + | |||
| + | Script venant de l' | ||
| + | <code bash> | ||
| + | [Unit] | ||
| + | Description=This service automatically renews any certbot certificates found | ||
| + | |||
| + | [Service] | ||
| + | EnvironmentFile=/ | ||
| + | Type=oneshot | ||
| + | ExecStart=/ | ||
| + | </ | ||
| + | |||
| + | |||
| + | Surtout de pas oublier d' | ||
| + | systemctl enable certbot-renew.timer | ||
| + | systemctl start certbot-renew.timer | ||
| + | systemctl status certbot-renew.timer | ||
| + | |||
| + | |||
| + | ===== Python ===== | ||
| + | |||
| + | https:// | ||
| + | |||
| + | Pour gérer le stop d'un script python, éviter le SIGTERM et utiliser le SIGINT (équivalent d'un Ctrl+c) | ||
| + | |||
| + | [Service] | ||
| + | KillSignal=SIGINT | ||
| + | |||
| + | |||