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
F139517200: D41448.id128084.diff
Fri, Dec 12, 11:49 PM
Unknown Object (File)
Wed, Dec 10, 1:11 PM
Unknown Object (File)
Sun, Nov 30, 7:16 PM
Unknown Object (File)
Sun, Nov 30, 6:53 PM
Unknown Object (File)
Sun, Nov 30, 6:41 PM
Unknown Object (File)
Wed, Nov 19, 12:14 AM
Unknown Object (File)
Nov 3 2025, 11:07 AM
Unknown Object (File)
Nov 3 2025, 6:53 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