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)
Sun, Dec 29, 4:47 PM
Unknown Object (File)
Dec 8 2024, 9:19 PM
Unknown Object (File)
Nov 24 2024, 8:02 AM
Unknown Object (File)
Nov 22 2024, 12:05 AM
Unknown Object (File)
Oct 31 2024, 5:03 PM
Unknown Object (File)
Oct 24 2024, 2:53 PM
Unknown Object (File)
Oct 3 2024, 9:17 AM
Unknown Object (File)
Oct 2 2024, 11:46 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
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