To my disappointment i had to discover, that this workaround does NOT work!
It seems impossible to properly kill the hanging greylisting process. I leave the script here, maybe someone can overlook it and suggest a better solution.
After upgrading my (SuSE)-Servers to Plesk Control Panel Version 9.2.2 and enabling built-in GreyListing Support one of these servers died randomly because of CPU overload.
server#>ps ax |grep "executable" | grep -v grep
13906 ? 00:07:05 executable
13911 ? 00:07:01 executable
13916 ? 00:07:07 executable
13921 ? 00:07:06 executable
13926 ? 00:07:05 executable
13939 ? 00:07:02 executable
[.....] and many, many more.....
Unknown to me.
The situation occurs randomly, sometimes multiple times per hour, while working completely faultless on other days.
Other people experience the same see http://forum.parallels.com/showthread.php?t=90550
I administrate other servers with nearly the same setup which do not face this problem, so i guess it has something to do with the mails examined, maybe an infinite loop while examining headers.
Besides disabling Greylisting at all, i have tried to monitor the greylisting executable processes with a cronjob and to kill stale processes above a certain count.
This prevented the server from dying due to lack of resources, but brought up a new problem with duplicate mails, because the sender smpt-connection has already timed out at this point, the sender will therefore try again - but mail-handling delivers the first mail anyway, after greylisting process has exited.
Because i assume, that the build-up of processes is caused by the initial call not exiting properly, i thought about a solution that kicks in before the greylisting executable is called and handles the error if it occurs.
My solution is basically a wrapper written in php to replace the original greylisting filter binary.
If called by plesk's qmail-queue-handlers, the wrapper in turn calls the renamed original binary as a child process and monitors it. if it exits properly, the result is passed through, if it does not exit within a certain time, the hanging child process is killed and the message passed through without modification.
server:#> cd /usr/local/psa/handlers/hooks
server:/u.../hooks #> cp -p grey grey.orig
server:/u.../hooks #> cp gl-wrapper.php grey
server:/u.../hooks #> cp gl-wrapper.php grey
server: #> ./grey gl-wd s1@domain.com r1@domain.com < SAMPLE.MSG
SKIPserver:/u.../hooks #
Notice the output SKIP, you can also examine your mail.info log. If you enabled debugging it should contain something like:
Oct 17 14:57:11 mail2you greylisting watchdog[11333]:
GreyListing Filter Watchdog: started...
Oct 17 14:57:11 mail2you greylisting watchdog[11333]:
greylisting filter child process started.
Oct 17 14:57:11 mail2you greylisting filter[11334]:
Starting greylisting filter...
Oct 17 14:57:11 mail2you greylisting watchdog[11333]:
greylisting filter returned after: 8.141ms with exitcode:5
Plesk update will overwrite the custom grey handler, if a new grey binary is delivered, hopefully correcting this error.
If not reinstalling the wrapper is a matter of seconds.
11/13/2009 18:23 comment #1 by james o
i was having the same problem. looks like plesk has a "hotfix" here: ***//kb.parallels.com/en/6875