[syslog-ng] sysutils/syslog-ng/files/syslong-ng.sh.in patch

Brian A. Seklecki lavalamp at spiritual-machines.org
Sat Nov 4 03:31:59 CET 2006

This is a nice little patch we use to purge out /dev/klog after 
/etc/rc.d/dmesg and before /usr/local/etc/rc.d/syslog-ng.sh.

It's useful for shops that translate user.info facility/priority syslog 
messages into SMS/E-Mail via a log{} mechanism (i.e., hardware error 
messages from the kernel, like some flunky in the NOC plugging a keyboard 
into your system).

It lets you avoid 200 lines of boot messages in log(9) making their way 
into your log{} mechanism or into your pager.

We want to feed it upstream because we think others will find it useful.


$ diff -u /usr/ports/sysutils/syslog-ng/files/syslog-ng.sh.in 

--- /usr/ports/sysutils/syslog-ng/files/syslog-ng.sh.in Wed Mar 29 
16:20:19 2006
+++ syslog-ng.sh.in     Fri Nov  3 20:32:59 2006
@@ -14,6 +14,8 @@

  . %%RC_SUBR%%

@@ -23,6 +25,11 @@
+if checkyesno syslog_ng_purgeklog; then
+        start_precmd="echo \"Purging klog(9)\" && sysctl -w 
kern.msgbuf_clear=1 $start_precmd";

  load_rc_config $name


 	-lava (Brian A. Seklecki - Pittsburgh, PA, USA)

"...from back in the heady days when "helpdesk" meant nothing, "diskquota"
meant everything, and lives could be bought and sold for a couple of pages
of laser printout - and frequently were."

More information about the syslog-ng mailing list