systemd avance et demarrage 20 min de lecture

Timers, boot et journal avance

systemd timers (remplacer cron)

# /etc/systemd/system/backup.timer
[Unit]
Description=Backup quotidien

[Timer]
OnCalendar=*-*-* 02:00:00
Persistent=true

[Install]
WantedBy=timers.target
systemctl list-timers              # Lister les timers actifs
systemctl enable --now backup.timer # Activer

Analyse de boot

systemd-analyze                    # Temps total de boot
systemd-analyze blame              # Temps par service
systemd-analyze critical-chain     # Chaine critique
systemd-analyze plot > boot.svg    # Graphique SVG

Targets

systemctl get-default              # Target par defaut
systemctl set-default multi-user.target  # Mode texte
systemctl set-default graphical.target   # Mode graphique
systemctl isolate rescue.target          # Mode rescue

Journal avance

journalctl --disk-usage            # Espace utilise
journalctl --vacuum-size=500M      # Limiter a 500M
journalctl -o json-pretty          # Format JSON
journalctl _SYSTEMD_UNIT=nginx.service  # Par unit
journalctl --since "2024-01-01" --until "2024-01-02"