service-monitor.c revision 6fdfa4d4cf14d1d7764d7faa8258f112e39c8dbe
2ronwalf/* Copyright (c) 2005-2009 Dovecot authors, see the included COPYING file */ /* we don't have any extra idling processes. and if there's no minimum limit, never kill the last process anyway */ /* process used up all of its clients */ /* we may need to start more */ /* process can accept more clients again */ /* we have more processes than we really need. add a bit of randomness so that we don't send the signal to all of them at once */ /* we've probably wait()ed it away already. ignore */ /* a) Process was closed and another process was created with the same PID, but we're still receiving status update from b) Some process is trying to corrupt our internal state by trying to pretend to be someone else. We could use stronger randomness here, but the worst they can do is DoS and there are already more serious problems if someone is able to do /* first status notification */ /* process started servicing some more clients */ /* process finished servicing some clients */ i_warning(
"service(%s): process_limit reached, " "client connections are being dropped",
/* reached process limit, notify processes that they need to start killing existing connections if they reach connection limit */ /* we've reached our limits, new clients will have to wait until there are more processes available */ /* create a child process and let it accept() this connection */ for (i = 0; i <
count; i++) {
/* we created some processes, they'll do the listening now */ for (i = 0; i <
count; i++) {
for (i = 0; i <
count; i++) {
for (i = 0; i <
count; i++) {
/* we haven't yet created status pipe */ for (i = 0; i <
2; i++) {
"close(status fd) failed: %m");
for (i = 0; i <
count; i++)
i_error(
"waitpid() returned unknown PID %s",