From 3bb16a48c37ed88ee75b9674f6b960b9bc89f7e6 Mon Sep 17 00:00:00 2001 From: ScottW514 Date: Wed, 2 Sep 2026 17:26:24 -0400 Subject: [PATCH] logging: the unix datagram queue holds a daemon's burst The daemons log to /dev/log with non-blocking datagrams and drop what the socket will not take. The kernel's default queue for a unix datagram socket is 10; forgectrl's arm-time burst alone was about 20, so the lines around every job start were lost, and the daemon reported 18 to 46 dropped per job on the bench. The logging init sets net.unix.max_dgram_qlen to 512 before rsyslog and the daemons start; nothing on the image applied sysctl files before. Bench: set at runtime on 20260902144848 for the rest of the session. Catalog consequence: a layer change; the meta-forgefirm content hash moves and nothing inherits on the image that ships it. --- .../forgefirm-logging/files/forgefirm-logging.init | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/meta-forgefirm/recipes-forgefirm/forgefirm-logging/files/forgefirm-logging.init b/meta-forgefirm/recipes-forgefirm/forgefirm-logging/files/forgefirm-logging.init index 056c035..1ccb74b 100644 --- a/meta-forgefirm/recipes-forgefirm/forgefirm-logging/files/forgefirm-logging.init +++ b/meta-forgefirm/recipes-forgefirm/forgefirm-logging/files/forgefirm-logging.init @@ -24,6 +24,13 @@ LEGACY=/data/forgefirm/legacy-logs RULES=/data/forgefirm/rsyslog-forgefirm.conf +# The daemons log to /dev/log with non-blocking datagrams and drop what +# the socket will not take. The kernel default queue is 10 datagrams; +# forgectrl's arm-time burst alone is about 20, so a 10-deep queue lost +# the lines around every job start (the named safing writes among them). +# 512 holds any burst the daemons make until rsyslog drains it. +DGRAM_QLEN=512 + render() { # syslog is not up yet at this point: report to the console if [ -x "$FORGECTRL" ]; then @@ -66,6 +73,8 @@ sweep_legacy() { case "$1" in start) + # before rsyslog (S20) and the daemons that log to it + [ -w /proc/sys/net/unix/max_dgram_qlen ] && echo "$DGRAM_QLEN" > /proc/sys/net/unix/max_dgram_qlen render sweep_legacy [ -x "$LOGROTATE" ] || exit 0