SCCS-vsn: usr.sbin/sendmail/src/conf.c 8.191
-static char sccsid[] = "@(#)conf.c 8.190 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c 8.191 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
** FALSE if we should accept new work.
**
** Side Effects:
** FALSE if we should accept new work.
**
** Side Effects:
+** Sets process title when it is rejecting connections.
*/
bool
refuseconnections()
{
extern bool enoughdiskspace();
*/
bool
refuseconnections()
{
extern bool enoughdiskspace();
+ extern void setproctitle();
#ifdef XLA
if (!xla_smtp_ok())
return TRUE;
#endif
#ifdef XLA
if (!xla_smtp_ok())
return TRUE;
#endif
- /* this is probably too simplistic */
- return CurrentLA >= RefuseLA || !enoughdiskspace(MinBlocksFree + 1);
+ if (CurrentLA >= RefuseLA)
+ {
+ setproctitle("rejecting connections: load average: %d",
+ CurrentLA);
+ }
+ else if (!enoughdiskspace(MinBlocksFree + 1))
+ {
+ setproctitle("rejecting connections: min free: %d",
+ MinBlocksFree);
+ }
+ else if (MaxChildren > 0 && CurChildren >= MaxChildren)
+ {
+ setproctitle("rejecting connections: maximum children: %d",
+ CurChildren);
+ }
+ else
+ return FALSE;
+ return TRUE;
}
\f/*
** SETPROCTITLE -- set process title for ps
}
\f/*
** SETPROCTITLE -- set process title for ps
}
# else
# ifdef WNOHANG
union wait status;
while (wait3(&status, WNOHANG, (struct rusage *) NULL) > 0)
}
# else
# ifdef WNOHANG
union wait status;
while (wait3(&status, WNOHANG, (struct rusage *) NULL) > 0)
# else /* WNOHANG */
auto int status;
while (wait(&status) > 0)
# else /* WNOHANG */
auto int status;
while (wait(&status) > 0)
# endif /* WNOHANG */
# endif
# ifdef SYS5SIGNALS
# endif /* WNOHANG */
# endif
# ifdef SYS5SIGNALS