Bug 4122 - behaviour of src/usr.sbin/syslogd
Summary: behaviour of src/usr.sbin/syslogd
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 2.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1997-07-19 19:30 UTC by joes
Modified: 1997-09-14 07:56 UTC (History)
0 users

See Also:


Attachments
file.diff (356 bytes, patch)
1997-07-19 19:30 UTC, joes
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description joes 1997-07-19 19:30:01 UTC
   The default behaviour of syslogd is to keep pipes open until
   no longer needed (I believe, based on man pages and experience).

   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.

How-To-Repeat: 
   Setup a logging definition to log to a pipe.
Comment 1 Joerg Wunsch 1997-07-31 22:06:32 UTC
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. ;-)
Comment 2 joes 1997-09-14 05:09:27 UTC
Hi, Joerg!

Could you please close this PR?  I don't see any need for it to stay open;
and I've written a work around in the Qpage program now, so it's a moot 
point. 

And, the explanation you gave made a lot of sense, too.

Thanks,

joe
Comment 3 Joerg Wunsch freebsd_committer freebsd_triage 1997-09-14 07:55:28 UTC
State Changed
From-To: open->closed


Documentation slightly improved in rev 1.7 of syslog.conf(5).  Apart from 
this, the way it works is a feature.