Skip to content

Instantly share code, notes, and snippets.

@DaffyDuke
Created March 3, 2017 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DaffyDuke/f00044b5eb89b729c87e73fdce7fd461 to your computer and use it in GitHub Desktop.
Save DaffyDuke/f00044b5eb89b729c87e73fdce7fd461 to your computer and use it in GitHub Desktop.
Systemd, systemct & journalctl sont sur un bateau

Full disk suite à l'activation de la persistence

when : enable systemd journal persistence (default limit to 10% of its partition)

vraiment ?

# du -sh /var/log/journal/
905M /var/log/journal/
# df -h /var/log
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vgos-varlv 7.8G 5.8G 1.6G 79% /var

il y a bien une subtilité : SystemMaxUse est a 10% SystemMaxFileSize est a 1/8 de SystemMaxUse a priori la taille totale possible est SystemMaxUse + SystemMaxFileSize soit 11,25% ici 898,56 M .. le compte n'est pas bon .. par contre il ne prend pas en compte les fichiers journaux corrompus (finissant par ~) , on peut les corriger avec un journalctl --verify

# journalctl --disk-usage
Archived and active journals take up 904.2M on disk.

si je redemarre le journald il dit bien :

Feb 13 15:37:15 localhost.localdomain systemd-journal[15611]: Permanent journal is using 904.2M (max allowed 793.5M, trying to leave 1.1G free of 1.8G available → current limit 904.2M).

pour forcer la purge / gagner temporairement de la place pour autre chose :

journalctl --vacuum-time=1w
journalctl --vacuum-size=100M
journalctl --vacuum-time=1d

apres purge , [les fichiers corrompus reconstruits apparaissant en root:root sont correctement supprimés ] on revient bien au fonctionnement nominal :

# journalctl -b -u systemd-journald
Feb 13 16:17:26 localhost.localdomain systemd-journal[30802]: Journal stopped
Feb 13 16:17:26 localhost.localdomain systemd-journal[3190]: Permanent journal is using 120.0M (max allowed 793.5M, trying to leave 1.1G free of 2.6G available → current limit 793.5M).
Feb 13 16:17:26 localhost.localdomain systemd-journal[3190]: Journal started

en conclusion ,

  • les fichiers journaux corrompus ne sont pas purgés , meme s'ils ont ete corrigés
  • il y a un overhead de consommation avec les fichiers journaux actif (un system et un par user )
  • la valeur de SystemMaxUse va etre revue a la baisse [le besoin initial est surtout d'avoir des logs du dernier boot voire de la semaine)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment