I've released my logselect program as a patch to daemontools-0.70.
It's at http://www.qmail.org/logselect-0.70.patch .  If you guessed
that logselect was used to select parts of a log, you're a happy
winner!  It's intended to be used in a multi-server environment.  By
itself it is of little use.  It's just a back-end.  It needs a client
program (as yet unwritten) to be useful.

You should patch daemontools, and make/make setup as usual.  Then you
can create a service whose run file looks like this:

#!/bin/sh
QMAILDUID=`id -u qmaill`
NOFILESGID=`id -g qmaill`
exec softlimit -m 2000000 \
tcpserver -p -x cdb -u QMAILDUID -g $NOFILESGID 0 642 \
/usr/local/bin/xargs -e EOF /usr/local/bin/logselect


In addition, the service directory should have symlinks pointing to
the log files you wish to make accessible.

Then, to fetch logs, you make a connection to port 642, and stuff four
lines down the TCP connection.  The first line contains the name of
the symlink you created.  The second contains a TAI64N for the start
of the period of interest.  The third contains a TAI64N for the stop
of the period of interest.  The fourth contains the literal string
"EOF".  All lines in the log file after the start but before the stop
will be returned.

No provision is made for authorization.  I leave that to a
theoretically possible authorization add-on to ucspi-tcp.

Anyone have any hints on where I should put this documentation?
I can release a patch to the code, but it's hard to release a patch to 
Dan's website without his cooperation in installing it.  I wrote the
program in Dan's style so that he could incorporate it into a future
version of daemontools.

-- 
-russ nelson <[EMAIL PROTECTED]>  http://russnelson.com  | If you think 
Crynwr sells support for free software  | PGPok | health care is expensive now
521 Pleasant Valley Rd. | +1 315 268 1925 voice | now, wait until you see
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   | what it costs when it's free. 

Reply via email to