Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Jul 1997 11:23:08 -0700 (PDT)
From:      Joseph Stein <joes@spiritone.com>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/4122: syslogd has undesired effect when logging to a program
Message-ID:  <199707191823.LAA00510@joes.users.spiritone.com>
Resent-Message-ID: <199707191830.LAA06294@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         4122
>Category:       bin
>Synopsis:       behaviour of src/usr.sbin/syslogd
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 19 11:30:01 PDT 1997
>Last-Modified:
>Originator:     Joseph Stein
>Organization:
>Release:        FreeBSD 2.2-STABLE i386
>Environment:

   This pr is based on a syslog.conf file that contains the following line:

*.warning					|/usr/local/bin/qpage -p joes

   qpage is the QuickPage daemon, which compiles more-or-less out of the
   box on FreeBSD.  (Read freebsd-questions (I think)) for the location.

>Description:

   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.

>Fix:

Index: src/usr.sbin/syslogd/syslogd.c
===================================================================
RCS file: /usr/cvs/src/usr.sbin/syslogd/syslogd.c,v
retrieving revision 1.12.2.6
diff -r1.12.2.6 syslogd.c
772a773,777
> 		(void)close(f->f_file);
> 		if (f->f_un.f_pipe.f_pid > 0)
> 			deadq_enter(f->f_un.f_pipe.f_pid);
> 		f->f_un.f_pipe.f_pid = 0;
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707191823.LAA00510>