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
Unknown Object (File)
Wed, Nov 19, 12:14 AM
Unknown Object (File)
Mon, Nov 3, 11:07 AM
Unknown Object (File)
Mon, Nov 3, 6:53 AM
Unknown Object (File)
Mon, Nov 3, 1:46 AM
Unknown Object (File)
Mon, Nov 3, 12:25 AM
Unknown Object (File)
Sat, Nov 1, 4:13 PM
Unknown Object (File)
Fri, Oct 31, 10:34 PM
Unknown Object (File)
Oct 26 2025, 7:52 AM
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