Page 1 of 1
qmail-scanner errors in /var/log/httpd/error_log
Posted: Mon Nov 08, 2010 12:21 pm
by breun
I was a bit surprised to find qmail-scanner related eroor messages in Apache's /var/log/httpd/error_log
getservbyname failed for tcp at /var/qmail/bin/qmail-scanner-queue.pl line 2985
udp connect: nobody listening at /var/qmail/bin/qmail-scanner-queue.pl line 2985
Note that these messages are not timestamped, while other lines in error_log are.
Does anyones have any idea what's going on here?
Re: qmail-scanner errors in /var/log/httpd/error_log
Posted: Mon Nov 08, 2010 3:35 pm
by scott
None whatsoever, thats really bizzare
Re: qmail-scanner errors in /var/log/httpd/error_log
Posted: Mon Nov 08, 2010 6:27 pm
by BruceLee
Just some ideas, I dont have a clue.
Do you use some kind of syslog tool? Maybe thats catching it?
Or maybe it's perl related?
Re: qmail-scanner errors in /var/log/httpd/error_log
Posted: Mon Nov 08, 2010 6:33 pm
by scott
yeah its something appending to the file. Definitely not through apache, do you have a lot of them?
Re: qmail-scanner errors in /var/log/httpd/error_log
Posted: Mon Nov 08, 2010 7:09 pm
by breun
Not a lot, but a couple every day on the server where I first saw this:
# grep -c 'getservbyname failed for tcp' /var/log/httpd/error_log*
/var/log/httpd/error_log:13
/var/log/httpd/error_log.1:4
/var/log/httpd/error_log.2:6
/var/log/httpd/error_log.3:7
/var/log/httpd/error_log.4:0
Grepping for the other message shows the same counts.
I see this behavior on at least four different servers, all of them CentOS 4 (none of our CentOS 5 servers show this), Plesk 9.5.3 (but also from when they were still on 9.5.2), both 32 and 64 bit. None of them have high counts, just a handful per log file.
Re: qmail-scanner errors in /var/log/httpd/error_log
Posted: Mon Nov 08, 2010 8:49 pm
by scott
Have you got any timestamped events bracketing those? Maybe that could be used to look up against the qmail-queue logs.
Re: qmail-scanner errors in /var/log/httpd/error_log
Posted: Tue Nov 09, 2010 3:31 am
by prupert
breun wrote:I was a bit surprised to find qmail-scanner related eroor messages in Apache's /var/log/httpd/error_log
getservbyname failed for tcp at /var/qmail/bin/qmail-scanner-queue.pl line 2985
udp connect: nobody listening at /var/qmail/bin/qmail-scanner-queue.pl line 2985
Note that these messages are not timestamped, while other lines in error_log are.
Does anyones have any idea what's going on here?
It sounds like a failed DNS lookup attempt. It might have something to do with an Apache process calling qmail-inject to send a message, failing the DNS lookup for sending the message and erroneously logging it to the Apache log.
Re: qmail-scanner errors in /var/log/httpd/error_log
Posted: Tue Nov 09, 2010 3:41 am
by breun
Line 2985 of /var/qmail/bin/qmail-scanner-queue.pl is:
Code: Select all
syslog('mail|info',"$msgtype: $msg");
It looks like qmail-scanner is trying to log a message to syslog here, but somehow the message ends up in the httpd error_log.
Re: qmail-scanner errors in /var/log/httpd/error_log
Posted: Tue Nov 09, 2010 7:40 am
by scott
I think prupert is on to something there with a web application is invoking qmail-inject directly.
Then its saying "ok log this event" but whatever hostname variable (or perhaps no hostname) its using doesnt resolve and therefore the syslog fails. Apache picks that up to error_log
Re: qmail-scanner errors in /var/log/httpd/error_log
Posted: Tue Nov 09, 2010 7:44 am
by breun
I don't think many scripts will invoke qmail-inject directly, but I can have a look. Could this also be the result of a PHP mail() call or something like that?
Re: qmail-scanner errors in /var/log/httpd/error_log
Posted: Tue Nov 09, 2010 8:36 am
by scott
definitely worth investigating, especially if its something that invokes it with a hostname variable that is null or invalid.
Re: qmail-scanner errors in /var/log/httpd/error_log
Posted: Tue Nov 09, 2010 10:15 am
by breun
I think clients are probably sending out newsletters to addresses that contain mistyped hostnames and other mistakes. We'll see if we can reproduce this issue by sending messages to invalid hostnames from a web page. I guess I'll probably need to bring this up with the qmail-scanner devs if that triggers it.
Re: qmail-scanner errors in /var/log/httpd/error_log
Posted: Tue Nov 09, 2010 12:27 pm
by scott
I think its the hostname variable being passed to qmail-scanner that it uses to figure out where syslog is.