Date: Fri, 11 May 2001 12:35:21 -0500 From: Dan Nelson <dnelson@emsphone.com> To: Michael Lucas <mwlucas@blackhelicopters.org> Cc: questions@FreeBSD.ORG Subject: Re: syslog.conf && executing programs Message-ID: <20010511123521.A2528@dan.emsphone.com> In-Reply-To: <20010511110227.A27757@blackhelicopters.org>; from "Michael Lucas" on Fri May 11 11:02:27 GMT 2001 References: <20010511110227.A27757@blackhelicopters.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (May 11), Michael Lucas said: > I'd like to use syslogd to mail me upon certain events. > > local3.* | /usr/bin/mail -s alert mwlucas > > The first time something is appended to the log, I get a mail. > > The second time, I get a hang: > > loghost/etc;ps -ax | grep mail > 25711 ?? Is 0:00.00 sh -c /usr/bin/mail -s alert mwlucas > 25712 ?? I 0:00.00 /usr/bin/mail -s alert mwlucas loghost/etc; For efficiency, syslogd treats the program as a pipe; it will spawn it once, then send log entries one line at a time as they come in. The child process will be killed after 60 seconds of idle time. Excerpt from syslog.conf manpage: So if it is desired that the subprocess should get exactly one line of input only (which can be very resource-consuming if there are a lot of messages flowing quickly), this can be achieved by exiting after just one line of input. If necessary, a script wrapper can be written to this effect. -- Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010511123521.A2528>