[syslog-ng] [PATCH] system(): Use follow-freq(1) on FreeBSD prior to 9.1

Gergely Nagy algernon at balabit.hu
Fri Nov 9 14:24:29 CET 2012


FreeBSD prior to 9.1 does not have a kqueue-pollable /dev/klog, so
syslog-ng would fall back to using timers, except that follow-freq()
is explicitly set to zero, also diabling timer-based polling. This has
the effect of making syslog-ng not read from /dev/klog at all.

To work around the issue, on FreeBSD prior to 9.1, use follow-freq(1)
for /dev/klog when using the system() source.

Signed-off-by: Gergely Nagy <algernon at balabit.hu>
---
 scl/system/generate-system-source.sh |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/scl/system/generate-system-source.sh b/scl/system/generate-system-source.sh
index 708a7a4..34cc009 100755
--- a/scl/system/generate-system-source.sh
+++ b/scl/system/generate-system-source.sh
@@ -74,7 +74,17 @@ EOF
 		cat <<EOF
 unix-dgram("/var/run/log");
 unix-dgram("/var/run/logpriv" perm(0600));
-file("/dev/klog" follow-freq(0) program-override("kernel") flags(no-parse));
+EOF
+                case "$osversion" in
+                        7.*|8.*|9.0*)
+                                ffreq=1
+                                ;;
+                        *)
+                                ffreq=0
+                                ;;
+                esac
+                cat <<EOF
+file("/dev/klog" follow-freq($ffreq) program-override("kernel") flags(no-parse));
 EOF
 		;;
 	GNU/kFreeBSD)
-- 
1.7.10.4




More information about the syslog-ng mailing list