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.
This commit is contained in:
ScottW514
2026-09-02 17:26:53 -04:00
parent 774ae52b61
commit 3bb16a48c3
@@ -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