Page MenuHomeFreeBSD

Buffering syslogd output to pipe
Needs ReviewPublic

Authored by slw_zxy.spb.ru on Aug 14 2023, 3:08 PM.
Tags
None
Referenced Files
F145619448: D41448.id125980.diff
Sun, Feb 22, 6:37 AM
F145619430: D41448.id125980.diff
Sun, Feb 22, 6:37 AM
F145580665: D41448.id125982.diff
Sat, Feb 21, 6:52 PM
Unknown Object (File)
Sat, Feb 21, 1:23 AM
Unknown Object (File)
Sat, Feb 21, 1:22 AM
Unknown Object (File)
Fri, Feb 20, 4:45 PM
Unknown Object (File)
Tue, Jan 27, 2:43 PM
Unknown Object (File)
Jan 15 2026, 11:29 PM
Subscribers

Details

Summary

syslogd currently does O_NONBLOCK output to pipe. As a result any micro-burst can cause an overflow of the pipe buffer (64KB) and kill the script.
Patch allows to buffer (-g SIZE total bytes) for up to 10 seconds per script before killing script.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

auto-tuning by hw.usermem and use __XSTRING

I plan to commit a number of syslogd patches this week (some refactoring from @jfree in preparation for running syslogd under Capsicum, see the patch stack starting with D41357), so please hold off on committing this for a bit.

/usr/src/usr.sbin/syslogd/syslogd.c
1995

cnt is size_t, an unsigned type, so this check is always false. It should be ssize_t.

cnt is size_t, an unsigned type, so this check is always false. It should be ssize_t.

I plan to commit a number of syslogd patches this week (some refactoring from @jfree in preparation for running syslogd under Capsicum, see the patch stack starting with D41357), so please hold off on committing this for a bit.

I can tailor a patch to fit your changes so you can commit it too.

Update to latest syslogd changes