Hey there guys,
Below is a copy of my log script (under svc). The first file listed
simply defines a variable and (from what I understand) operates as a pointer
to the log-functions script.
I was hoping that someone could break this down for me so I could reduce the
information my log file is recording about pop3 connections. I try to run a
really tight ship over here, and I am finding all this extra information to
be quite a waste of space. The run-functions script is completely foreign
to me.. And I am not understanding the operators and how the output works
out from the qmail-service to the tcpserver. After both scripts is an
excerpt out of my maillog log file, and below that is what I would hope I
could have the output look like:
[user1@www /]# less /service/pop3d/log/run
#!/bin/sh
service=pop-3
. /usr/share/qmail/log-functions
[user1@www /]# less /usr/share/qmail/log-functions
#
# log-functions This file contains functions common to the qmail log
scripts
#
. /usr/share/qmail/run-functions
# Read the default logger command, making sure that any pipe symbols are
# separated, and substituting '{}' with the service name.
readdefault logger logger splogger
logger=`echo $logger | \
sed -e 's/|/ | /' -e '/{}/!s/$/ '$service/ -e 's/{}/'$service/g`
cd /var/log
exec setuidgid qmaillog $logger
EXERPT FROM MAILLOG
Mar 4 14:30:16 www pop-3: 983745016.901284 tcpserver: status: 1/40
Mar 4 14:30:16 www pop-3: 983745016.904990 tcpserver: pid 6733 from
24.76.51.175
Mar 4 14:30:16 www pop-3: 983745016.927190 tcpserver: ok 6733
:64.69.78.221:110 h24-76-51-175.vf.shawcable.net:24.76.51.175::50666
Mar 4 14:30:18 www pop-3: 983745018.588849 tcpserver: end 6733 status 256
Mar 4 14:30:18 www pop-3: 983745018.591199 tcpserver: status: 0/40
THIS IS WHAT I WOULD LIKE THE EXECRPT FOR LOOK LIKE:
Mar 4 14:40:18 www pop-3: 983745618.531077 tcpserver: ok 13160
:64.69.78.221:110 h24-76-51-175.vf.shawcable.net:24.76.51.175::50677
Basically, I just want one line of information, because this is the ONLY
service I have that is not recording information in this log, it would also
be good for me to be able to remove information from after the date to just
after tcpserver:. In effect making it look like this:
Mar 4 14:40:18 ok 13160 :64.69.78.221:110
h24-76-51-175.vf.shawcable.net:24.76.51.175::50677
The only other thing that is not necessary is showing the server IP:PORT
(64.69.78.221:110).. But that is the least of my worries.
Any ideas?
Cheers,
Sean