Date: Thu, 31 Jul 1997 14:30:01 -0700 (PDT) From: j@uriah.heep.sax.de (J Wunsch) To: freebsd-bugs Subject: Re: bin/4122: syslogd has undesired effect when logging to a program Message-ID: <199707312130.OAA05057@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/4122; it has been noted by GNATS. From: j@uriah.heep.sax.de (J Wunsch) To: joes@spiritone.com Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/4122: syslogd has undesired effect when logging to a program Date: Thu, 31 Jul 1997 23:06:32 +0200 As Joseph Stein wrote: > The default behaviour of syslogd is to keep pipes open until > no longer needed (I believe, based on man pages and experience). This was intention. Actually, the process is being shut down after some (rather long, i think 2 x `mark interval', i.e. 40 minutes by default) time. > This can be undesired if you wish to have any types of syslog messages > transmitted to an alphanumeric pager, because it can take a long time > (in one case here, about twelve hours) for the pipe to be closed, and > therefore the page to be sent. (in this case). > > I poked around in the source for syslogd and think I have come to > a compatible change, that closes the pipe after each log entry is > written. > > I realize that this is an inefficient use of system resources; but > it was the easiest way to achieve my desired result. This was exactly the reason why i didn't implement it this way (unlike it is done on SGI IRIX, where this idea has been taken from). syslog messages are always just one line, so i thought it would be reasonable that the program these messages are being piped into could handle the case of `important' messages itself well enough. I realize that this is a compromise, but generally closing the pipe after each message is IMHO more unacceptable, since you can't workaround the resource wastage in the filter program (think of logging events that might happen for a short period with thousands of events per second -- nothing that hasn't been seen yet). You can however work around the pipe not being closed in the filter program -- in the simplest case, wrap it with a shell script that reads exactly one line of input, and then exits. (SGI IRIX apparently didn't care about resource wastage. I think we should.) Unless somebody seriously disagrees with my opinion here, i suggest to close the PR without further action. If someone suggests a manpage addition that enlightens the above reasoning (perhaps with some examples), i absolutely don't mind adding this. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707312130.OAA05057>