Kill qpsmtpd after 1h instead of 30min

tags/ipasserelle-base-0.2.65-1 0.2.5
Daniel Berteaud 13 years ago
parent 5cdd0d42a6
commit 005048900b
  1. 5
      ipasserelle-base.spec
  2. 4
      root/etc/cron.hourly/qpsmtpd-cleanup

@ -1,4 +1,4 @@
%define version 0.2.4 %define version 0.2.5
%define release 1 %define release 1
%define name ipasserelle-base %define name ipasserelle-base
@ -45,6 +45,9 @@ Based on SMEServer, iPasserelle is a specially configured
SME Server, with some additionnal modules SME Server, with some additionnal modules
%changelog %changelog
* Tue Apr 24 2012 Daniel Berteaud <daniel@firewall-services.com> 0.2.5-1.sme
- Kill qpsmtpd after 1h instead of 30min
* Mon Apr 16 2012 Daniel Berteaud <daniel@firewall-services.com> 0.2.4-1.sme * Mon Apr 16 2012 Daniel Berteaud <daniel@firewall-services.com> 0.2.4-1.sme
- Revert previous commit, havp is now in front of squid - Revert previous commit, havp is now in front of squid

@ -10,8 +10,8 @@ $t = new Proc::ProcessTable;
foreach $p ( @{$t->table} ){ foreach $p ( @{$t->table} ){
next unless $p->cmndline =~ m#^/usr/bin/qpsmtpd-forkserver#; next unless $p->cmndline =~ m#^/usr/bin/qpsmtpd-forkserver#;
my $diff = time - $p->start; my $diff = time - $p->start;
# Process is more than 30 minutes old ? # Process is more than 1 hour old ?
if ($diff > 1800){ if ($diff > 3600){
syslog('info', "Killing PID " . $p->pid . "(" . $p->cmndline . syslog('info', "Killing PID " . $p->pid . "(" . $p->cmndline .
") because it looks like a stalled qpsmtpd process"); ") because it looks like a stalled qpsmtpd process");
$p->kill(9); $p->kill(9);

Loading…
Cancel
Save