bug-sh-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tailfd an d teepee


From: Marian Eichholz
Subject: tailfd an d teepee
Date: Thu, 10 May 2001 11:20:41 +0200

Hello,

Some weeks ago I wrote some extensions to tail and tee and would like to
contribute them to the shtools.

tailfd is an extension like tail -f, but it works as a daemon and has
some special semantics dealing with changing INODEs, restarts and other
24 hours background stuff.

teepee is like tee, but it delivers to additional pipes. Again, this
functionality shouldn't bloat the original concise tee code.

Finally, tailfdx is a combination of these tools and maintains a set of
process distributions defined in a configuration file.

Please have a look to the attached manpages to decide, if You are
interested in the code.
Since I am not experienced with package integration issues, I ask You as
the maintainers.
I'll send You the sources (3 humble c files) if You are interested.

-- 
Mit freundlichen Gruessen / Yours sincerely

Marian Eichholz

- - - - - - - - - - - 
Marian Eichholz
Postmaster
freenet.de AG          Vorsitzender des Aufsichtsrates: Gerhard Schmid
Deelbögenkamp 4c       Vorstand: Eckhard Spoerr (Vors.), Axel Krieger
22297 Hamburg          Amtsgericht Hamburg, HRB 74048
.rn '' }`
''' $RCSfile$$Revision$$Date$
'''
''' $Log$
'''
.de Sh
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp
.if t .sp .5v
.if n .sp
..
.de Ip
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.de Vb
.ft CW
.nf
.ne \\$1
..
.de Ve
.ft R

.fi
..
'''
'''
'''     Set up \*(-- to give an unbreakable dash;
'''     string Tr holds user defined translation string.
'''     Bell System Logo is used as a dummy character.
'''
.tr \(*W-|\(bv\*(Tr
.ie n \{\
.ds -- \(*W-
.ds PI pi
.if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
.ds L" ""
.ds R" ""
'''   \*(M", \*(S", \*(N" and \*(T" are the equivalent of
'''   \*(L" and \*(R", except that they are used on ".xx" lines,
'''   such as .IP and .SH, which do another additional levels of
'''   double-quote interpretation
.ds M" """
.ds S" """
.ds N" """""
.ds T" """""
.ds L' '
.ds R' '
.ds M' '
.ds S' '
.ds N' '
.ds T' '
'br\}
.el\{\
.ds -- \(em\|
.tr \*(Tr
.ds L" ``
.ds R" ''
.ds M" ``
.ds S" ''
.ds N" ``
.ds T" ''
.ds L' `
.ds R' '
.ds M' `
.ds S' '
.ds N' `
.ds T' '
.ds PI \(*p
'br\}
.\"     If the F register is turned on, we'll generate
.\"     index entries out stderr for the following things:
.\"             TH      Title 
.\"             SH      Header
.\"             Sh      Subsection 
.\"             Ip      Item
.\"             X<>     Xref  (embedded
.\"     Of course, you have to process the output yourself
.\"     in some meaninful fashion.
.if \nF \{
.de IX
.tm Index:\\$1\t\\n%\t"\\$2"
..
.nr % 0
.rr F
.\}
.TH tailfd 8 "Ver. 0.18" "12/Mar/2001" "ME tools"
.UC
.if n .hy 0
.if n .na
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.de CQ          \" put $1 in typewriter font
.ft CW
'if n "\c
'if t \\&\\$1\c
'if n \\&\\$1\c
'if n \&"
\\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7
'.ft R
..
.\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2
.       \" AM - accent mark definitions
.bd B 3
.       \" fudge factors for nroff and troff
.if n \{\
.       ds #H 0
.       ds #V .8m
.       ds #F .3m
.       ds #[ \f1
.       ds #] \fP
.\}
.if t \{\
.       ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.       ds #V .6m
.       ds #F 0
.       ds #[ \&
.       ds #] \&
.\}
.       \" simple accents for nroff and troff
.if n \{\
.       ds ' \&
.       ds ` \&
.       ds ^ \&
.       ds , \&
.       ds ~ ~
.       ds ? ?
.       ds ! !
.       ds /
.       ds q
.\}
.if t \{\
.       ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.       ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.       ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.       ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.       ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.       ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10'
.       ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m'
.       ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.       ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10'
.\}
.       \" troff and (daisy-wheel) nroff accents
.ds : 
\\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds v 
\\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#]
.ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u'
.ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u'
.ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#]
.ds o 
\\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.ds oe o\h'-(\w'o'u*4/10)'e
.ds Oe O\h'-(\w'O'u*4/10)'E
.       \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.       \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.       ds : e
.       ds 8 ss
.       ds v \h'-1'\o'\(aa\(ga'
.       ds _ \h'-1'^
.       ds . \h'-1'.
.       ds 3 3
.       ds o a
.       ds d- d\h'-1'\(ga
.       ds D- D\h'-1'\(hy
.       ds th \o'bp'
.       ds Th \o'LP'
.       ds ae ae
.       ds Ae AE
.       ds oe oe
.       ds Oe OE
.\}
.rm #[ #] #H #V #F C
.SH "NAME"
tailfd \- monitor a log file
.SH "SYNOPSIS"
\fBtailfd\fR { \fIoptions\fR } \fIfile\fR \fIslave\fR 
.SH "DESCRIPTION"
\fBtailfd\fR watches a log file and transfers all changes to a slave
pipe. The pipe can distribute these lines to other facilities or
processors.
.PP
The distribution is done on a line-by-line base. Lines are terminated
with LF.
.PP
The daemon can be shut down at any point by SIGTERM and restarted by
SIGHUP. It logs to the \fIsyslog\fR on the DAEMON\-Facility.
.SH "OPTIONS"
.Ip "\fB\-c\fR \fIconfig-file\fR" 3
Use the alternate \fIconfig-file\fR instead of \fI/etc/tailfd.conf\fR.
.Ip "\fB\-d\fR \fIdebugmask\fR" 3
Enable debugging messages. Debugging ist performed through syslog. The
debugging mask is a bitvector. The meaning of the particular debugging
flags \fIDEBUG_xxxx\fR can be looked up at the source code.
.Ip "\fB\-f\fR" 3
Run in foreground and do not daemonize. This is especially useful with
the debugging option \fB\-d\fR to see the messages on \fBstderr\fR.
.Ip "\fB\-q\fR" 3
Run in quiet mode. Only errors and important messages are logged.
.Ip "\fB\-V\fR" 3
Tell the version number.
.SH "EXAMPLE"
.PP
.Vb 2
\&  tailfd -f /var/log/exim_mainlog teepee "/home/mrtg/bin/mrtg-exim" \e
\&                        "anywatcher -"
.Ve
.SH "BUGS"
Tell me...
.SH "VERSION"
$Id: tailfd.pod,v 0.17 2001/03/09 12:41:28 marian Exp marian $
.SH "AUTHOR"
Marian Eichholz <address@hidden>
.SH "HISTORY"
See \fIREADME.HISTORY\fR

.rn }` ''
.IX Title "tailfd 8"
.IX Name "tailfd - monitor a log file"

.IX Header "NAME"

.IX Header "SYNOPSIS"

.IX Header "DESCRIPTION"

.IX Header "OPTIONS"

.IX Item "\fB\-c\fR \fIconfig-file\fR"

.IX Item "\fB\-d\fR \fIdebugmask\fR"

.IX Item "\fB\-f\fR"

.IX Item "\fB\-q\fR"

.IX Item "\fB\-V\fR"

.IX Header "EXAMPLE"

.IX Header "BUGS"

.IX Header "VERSION"

.IX Header "AUTHOR"

.IX Header "HISTORY"

.rn '' }`
''' $RCSfile$$Revision$$Date$
'''
''' $Log$
'''
.de Sh
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp
.if t .sp .5v
.if n .sp
..
.de Ip
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.de Vb
.ft CW
.nf
.ne \\$1
..
.de Ve
.ft R

.fi
..
'''
'''
'''     Set up \*(-- to give an unbreakable dash;
'''     string Tr holds user defined translation string.
'''     Bell System Logo is used as a dummy character.
'''
.tr \(*W-|\(bv\*(Tr
.ie n \{\
.ds -- \(*W-
.ds PI pi
.if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
.ds L" ""
.ds R" ""
'''   \*(M", \*(S", \*(N" and \*(T" are the equivalent of
'''   \*(L" and \*(R", except that they are used on ".xx" lines,
'''   such as .IP and .SH, which do another additional levels of
'''   double-quote interpretation
.ds M" """
.ds S" """
.ds N" """""
.ds T" """""
.ds L' '
.ds R' '
.ds M' '
.ds S' '
.ds N' '
.ds T' '
'br\}
.el\{\
.ds -- \(em\|
.tr \*(Tr
.ds L" ``
.ds R" ''
.ds M" ``
.ds S" ''
.ds N" ``
.ds T" ''
.ds L' `
.ds R' '
.ds M' `
.ds S' '
.ds N' `
.ds T' '
.ds PI \(*p
'br\}
.\"     If the F register is turned on, we'll generate
.\"     index entries out stderr for the following things:
.\"             TH      Title 
.\"             SH      Header
.\"             Sh      Subsection 
.\"             Ip      Item
.\"             X<>     Xref  (embedded
.\"     Of course, you have to process the output yourself
.\"     in some meaninful fashion.
.if \nF \{
.de IX
.tm Index:\\$1\t\\n%\t"\\$2"
..
.nr % 0
.rr F
.\}
.TH TEEPEE 1 "Ver. 0.18" "12/Mar/2001" "ME tools"
.UC
.if n .hy 0
.if n .na
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.de CQ          \" put $1 in typewriter font
.ft CW
'if n "\c
'if t \\&\\$1\c
'if n \\&\\$1\c
'if n \&"
\\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7
'.ft R
..
.\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2
.       \" AM - accent mark definitions
.bd B 3
.       \" fudge factors for nroff and troff
.if n \{\
.       ds #H 0
.       ds #V .8m
.       ds #F .3m
.       ds #[ \f1
.       ds #] \fP
.\}
.if t \{\
.       ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.       ds #V .6m
.       ds #F 0
.       ds #[ \&
.       ds #] \&
.\}
.       \" simple accents for nroff and troff
.if n \{\
.       ds ' \&
.       ds ` \&
.       ds ^ \&
.       ds , \&
.       ds ~ ~
.       ds ? ?
.       ds ! !
.       ds /
.       ds q
.\}
.if t \{\
.       ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.       ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.       ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.       ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.       ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.       ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10'
.       ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m'
.       ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.       ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10'
.\}
.       \" troff and (daisy-wheel) nroff accents
.ds : 
\\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds v 
\\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#]
.ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u'
.ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u'
.ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#]
.ds o 
\\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.ds oe o\h'-(\w'o'u*4/10)'e
.ds Oe O\h'-(\w'O'u*4/10)'E
.       \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.       \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.       ds : e
.       ds 8 ss
.       ds v \h'-1'\o'\(aa\(ga'
.       ds _ \h'-1'^
.       ds . \h'-1'.
.       ds 3 3
.       ds o a
.       ds d- d\h'-1'\(ga
.       ds D- D\h'-1'\(hy
.       ds th \o'bp'
.       ds Th \o'LP'
.       ds ae ae
.       ds Ae AE
.       ds oe oe
.       ds Oe OE
.\}
.rm #[ #] #H #V #F C
.SH "NAME"
teepee \- distribute standard input to processes
.SH "SYNOPSIS"
\&... | \fBteepee\fR { \fIoptions\fR } \*(L"proc arg" \*(L"proc arg\*(R" ...> 
.SH "DESCRIPTION"
\fBteepee\fR listens on \fBstdin\fR distributes all lines (terminated with
LF) to child processes. The child processes are given in plain shell
notation as arguments. One argument specifies one process with all
it's options and own arguments. Thus, care must be taken with correct
escaping.
.PP
\fBteepee\fR is a regular program, without any daemon magic. Nevertheless
it is intended to be used with the \fItailfd\fR daemon as source.
.PP
The program ist silent and does not output anything but errors (on
\fBstderr\fR).
.SH "OPTIONS"
.Ip "\fB\-d\fR \fIdebugmask\fR" 3
Enable debugging messages. Debugging ist performed through syslog. The
debugging mask is a bitvector. The meaning of the particular debugging
flags \fIDEBUG_xxxx\fR can be looked up at the source code.
.Ip "\fB\-f\fR" 3
Run in foreground and do not daemonize. This is especially useful with
the debugging option \fB\-d\fR to see the messages on \fBstderr\fR.
.Ip "\fB\-V\fR" 3
Tell the version number.
.SH "VERSION"
$Id: teepee.pod,v 0.17 2001/03/09 12:38:03 marian Exp marian $
.SH "AUTHOR"
Marian Eichholz <address@hidden>
.SH "HISTORY"
See \fIREADME.HISTORY\fR

.rn }` ''
.IX Title "TEEPEE 1"
.IX Name "teepee - distribute standard input to processes"

.IX Header "NAME"

.IX Header "SYNOPSIS"

.IX Header "DESCRIPTION"

.IX Header "OPTIONS"

.IX Item "\fB\-d\fR \fIdebugmask\fR"

.IX Item "\fB\-f\fR"

.IX Item "\fB\-V\fR"

.IX Header "VERSION"

.IX Header "AUTHOR"

.IX Header "HISTORY"

.rn '' }`
''' $RCSfile$$Revision$$Date$
'''
''' $Log$
'''
.de Sh
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp
.if t .sp .5v
.if n .sp
..
.de Ip
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.de Vb
.ft CW
.nf
.ne \\$1
..
.de Ve
.ft R

.fi
..
'''
'''
'''     Set up \*(-- to give an unbreakable dash;
'''     string Tr holds user defined translation string.
'''     Bell System Logo is used as a dummy character.
'''
.tr \(*W-|\(bv\*(Tr
.ie n \{\
.ds -- \(*W-
.ds PI pi
.if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
.ds L" ""
.ds R" ""
'''   \*(M", \*(S", \*(N" and \*(T" are the equivalent of
'''   \*(L" and \*(R", except that they are used on ".xx" lines,
'''   such as .IP and .SH, which do another additional levels of
'''   double-quote interpretation
.ds M" """
.ds S" """
.ds N" """""
.ds T" """""
.ds L' '
.ds R' '
.ds M' '
.ds S' '
.ds N' '
.ds T' '
'br\}
.el\{\
.ds -- \(em\|
.tr \*(Tr
.ds L" ``
.ds R" ''
.ds M" ``
.ds S" ''
.ds N" ``
.ds T" ''
.ds L' `
.ds R' '
.ds M' `
.ds S' '
.ds N' `
.ds T' '
.ds PI \(*p
'br\}
.\"     If the F register is turned on, we'll generate
.\"     index entries out stderr for the following things:
.\"             TH      Title 
.\"             SH      Header
.\"             Sh      Subsection 
.\"             Ip      Item
.\"             X<>     Xref  (embedded
.\"     Of course, you have to process the output yourself
.\"     in some meaninful fashion.
.if \nF \{
.de IX
.tm Index:\\$1\t\\n%\t"\\$2"
..
.nr % 0
.rr F
.\}
.TH tailfdx 8 "Ver. 0.18" "12/Mar/2001" "ME tools"
.UC
.if n .hy 0
.if n .na
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.de CQ          \" put $1 in typewriter font
.ft CW
'if n "\c
'if t \\&\\$1\c
'if n \\&\\$1\c
'if n \&"
\\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7
'.ft R
..
.\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2
.       \" AM - accent mark definitions
.bd B 3
.       \" fudge factors for nroff and troff
.if n \{\
.       ds #H 0
.       ds #V .8m
.       ds #F .3m
.       ds #[ \f1
.       ds #] \fP
.\}
.if t \{\
.       ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.       ds #V .6m
.       ds #F 0
.       ds #[ \&
.       ds #] \&
.\}
.       \" simple accents for nroff and troff
.if n \{\
.       ds ' \&
.       ds ` \&
.       ds ^ \&
.       ds , \&
.       ds ~ ~
.       ds ? ?
.       ds ! !
.       ds /
.       ds q
.\}
.if t \{\
.       ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.       ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.       ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.       ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.       ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.       ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10'
.       ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m'
.       ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.       ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10'
.\}
.       \" troff and (daisy-wheel) nroff accents
.ds : 
\\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds v 
\\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#]
.ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u'
.ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u'
.ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#]
.ds o 
\\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.ds oe o\h'-(\w'o'u*4/10)'e
.ds Oe O\h'-(\w'O'u*4/10)'E
.       \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.       \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.       ds : e
.       ds 8 ss
.       ds v \h'-1'\o'\(aa\(ga'
.       ds _ \h'-1'^
.       ds . \h'-1'.
.       ds 3 3
.       ds o a
.       ds d- d\h'-1'\(ga
.       ds D- D\h'-1'\(hy
.       ds th \o'bp'
.       ds Th \o'LP'
.       ds ae ae
.       ds Ae AE
.       ds oe oe
.       ds Oe OE
.\}
.rm #[ #] #H #V #F C
.SH "NAME"
tailfd \- multiplex log file changes
.SH "SYNOPSIS"
\fBtailfd\fR [\fB\-c\fR \fIconfig-file\fR ] { \fIoptions\fR }
.SH "DESCRIPTION"
\fBtailfd\fR watches a log file and distributes all changes to so called
\fIdestinations\fR on a line-by-line basis. Normally it runs as a daemon
and logs to the \fIsyslog\fR daemon.
.PP
The notion \fIdestination\fR means files as well as processes, that are
capable of receiving input through \fBstdin\fR. These destinations are
specified in the configuration file.
.PP
The configuration file is normally read from \fI/etc/tailfd.conf\fR but
can be read from elsewhere through the \fB\-c\fR option.
.PP
The daemon can be shut down at any point by SIGTERM and restarted by
SIGHUP. It uses the file \fI/var/Run/tailfd.status\fR as non volatile
memory. You can specify another file name in the configuration file
(see below).
.PP
The Daemon logs to the \fIsyslog\fR on the DAEMON\-Facility.
.PP
It creates a normal PID file in \fI/var/run/tailfd.pid\fR
unless otherwise stated in the configuration file.
.SH "OPTIONS"
.Ip "\fB\-c\fR \fIconfig-file\fR" 3
Use the alternate \fIconfig-file\fR instead of \fI/etc/tailfd.conf\fR.
.Ip "\fB\-d\fR \fIdebugmask\fR" 3
Enable debugging messages. Debugging ist performed through syslog. The
debugging mask is a bitvector. The meaning of the particular debugging
flags \fIDEBUG_xxxx\fR can be looked up at the source code.
.Ip "\fB\-f\fR" 3
Run in foreground and do not daemonize. This is especially useful with
the debugging option \fB\-d\fR to see the messages on \fBstderr\fR.
.Ip "\fB\-q\fR" 3
Run in quiet mode. Only errors and important messages are logged.
.Ip "\fB\-r\fR" 3
Restart broken destinations. Normally, when a destination fails (disk
full or broken pipe), the daemon marks it internally as unusuable and
continues it's work without this specific destination. With the option
\fB\-r\fR it tries to restart the destination (re-create the pipe, the
file or whatever) and aborts, if this attempt fails. It's up to Your
policy.
.Ip "\fB\-t\fR \fIseconds\fR" 3
Allow the monitored file to be inaccessable for \fIseconds\fR before the
daemon aborts. Any external facility (loke a log cycler) has to
respect this contraint. \fIseconds\fR defaults to 5 seconds.
.Ip "\fB\-V\fR" 3
Tell other version number.
.SH "CONFIGURATION FILE"
The configuration files is in the INI style and consists of
\fISECTIONS\fR that in turn contain \fIkey\fR to \fIvalue\fR
\-assignments. Currently only string type assignments are supported.
.PP
There may be \fIcomments\fR in the UNIX style with lattices (#) in the
first column.
.Sh "The \s-1DAEMON\s0 section"
In the \s-1DAEMON\s0 section global settings are specified.
.Ip "\fIstatusfile\fR" 4
The name of the nonvolatile memory of this particular instance,
overriding the default.
.Ip "\fIpidfile\fR" 4
The name of the \s-1PID\s0 file, overriding the default.
.PP
The other sections specify so called \fIdestinations\fR.  A destination
is the distribution end point for each line of the monitored
file. They can be a plain file or a pipe process (when the \fIcommand\fR
key is present).
.Sh "Destinations"
.Ip "\fIstdout\fR" 4
The key specifies a file, that is open by the daemons. If there is no
\fIcommand\fR given, this file is the direct destination. Normally, this
file is connected to the \fBstdout\fR of the pipe. It may be omitted, if
the pipe does not write to \fBstdout\fR at all.
.Sp
The file is created and truncated per default. It can be appended as
well, if the name is prefixed with a greater-than-sign, like in
\fIstdout=\*(R"\fRmailer.log"> (see the example below.)
.Ip "\fIargs\fR" 4
The optional arguments for the command can be specified here. They are
separated by whitespace. Thus, whitespace itself within the single
arguments must be escaped with backslashes. Additionally, You can
specify \s-1CTRL\s0 codes 0-25 (\fB\ea\fR \- \fB\ez\fR) and every other 
character
with the octal notation (\fB\e000\fR \- \fB\e777\fR). Of course, the
backslash itself must be escaped (\fB\e\e\fR) just like the double quotes
(\fB\e\*(R"\fR).
.SH "EXAMPLE"
.PP
.Vb 4
\& [DAEMON]
\& statusfile = "temp.status"
\&    pidfile = "temp.pid"
\&   workdir  = "/home/marian/src/tailfd"
.Ve
.Vb 10
\& [testlog1]
\& command = "logalyzer"
\& args="-c file\ee with\ee space -"
\& stdout=">temp.catout"
\& 
\& [testlog2]
\& command = "/usr/local/bin/mklogstat"
\& 
\& [FileBin]
\& stdout="temp.out"
.Ve
.SH "BUGS"
Tell me...
.SH "VERSION"
$Id: tailfdx.pod,v 0.17 2001/03/06 16:39:43 marian Exp marian $
.SH "AUTHOR"
Marian Eichholz <address@hidden>
.SH "HISTORY"
See \fIREADME.HISTORY\fR

.rn }` ''
.IX Title "tailfdx 8"
.IX Name "tailfd - multiplex log file changes"

.IX Header "NAME"

.IX Header "SYNOPSIS"

.IX Header "DESCRIPTION"

.IX Header "OPTIONS"

.IX Item "\fB\-c\fR \fIconfig-file\fR"

.IX Item "\fB\-d\fR \fIdebugmask\fR"

.IX Item "\fB\-f\fR"

.IX Item "\fB\-q\fR"

.IX Item "\fB\-r\fR"

.IX Item "\fB\-t\fR \fIseconds\fR"

.IX Item "\fB\-V\fR"

.IX Header "CONFIGURATION FILE"

.IX Subsection "The \s-1DAEMON\s0 section"

.IX Item "\fIstatusfile\fR"

.IX Item "\fIpidfile\fR"

.IX Subsection "Destinations"

.IX Item "\fIstdout\fR"

.IX Item "\fIargs\fR"

.IX Header "EXAMPLE"

.IX Header "BUGS"

.IX Header "VERSION"

.IX Header "AUTHOR"

.IX Header "HISTORY"


reply via email to

[Prev in Thread] Current Thread [Next in Thread]