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)
Tue, May 21, 6:08 PM
Unknown Object (File)
Tue, May 21, 5:25 PM
Unknown Object (File)
Mon, May 20, 12:05 PM
Unknown Object (File)
Sun, May 19, 5:40 PM
Unknown Object (File)
Fri, May 17, 4:40 PM
Unknown Object (File)
Thu, May 16, 10:14 PM
Unknown Object (File)
Thu, May 16, 10:14 PM
Unknown Object (File)
Tue, May 7, 6:30 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
1988 ↗(On Diff #125967)

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