--- rpms/e-smith-pop3/sme8/e-smith-pop3-2.2.0-PopSoftlimit.patch 2012/07/04 00:23:04 1.1 +++ rpms/e-smith-pop3/sme8/e-smith-pop3-2.2.0-PopSoftlimit.patch 2012/07/06 06:27:57 1.2 @@ -1,42 +1,70 @@ -diff -ruN e-smith-pop3-2.2.0.old/root/etc/e-smith/db/configuration/defaults/pop3/Softlimit e-smith-pop3-2.2.0/root/etc/e-smith/db/configuration/defaults/pop3/Softlimit ---- e-smith-pop3-2.2.0.old/root/etc/e-smith/db/configuration/defaults/pop3/Softlimit 1970-01-01 01:00:00.000000000 +0100 -+++ e-smith-pop3-2.2.0/root/etc/e-smith/db/configuration/defaults/pop3/Softlimit 2012-07-03 04:18:05.000000000 +0100 -@@ -0,0 +1 @@ -+40000000 -diff -ruN e-smith-pop3-2.2.0.old/root/etc/e-smith/db/configuration/defaults/pop3s/Softlimit e-smith-pop3-2.2.0/root/etc/e-smith/db/configuration/defaults/pop3s/Softlimit ---- e-smith-pop3-2.2.0.old/root/etc/e-smith/db/configuration/defaults/pop3s/Softlimit 1970-01-01 01:00:00.000000000 +0100 -+++ e-smith-pop3-2.2.0/root/etc/e-smith/db/configuration/defaults/pop3s/Softlimit 2012-07-03 04:18:05.000000000 +0100 -@@ -0,0 +1 @@ -+40000000 +diff -ruN e-smith-pop3-2.2.0.old/createlinks e-smith-pop3-2.2.0/createlinks +--- e-smith-pop3-2.2.0.old/createlinks 2012-07-06 05:38:19.000000000 +0100 ++++ e-smith-pop3-2.2.0/createlinks 2012-07-06 06:32:52.000000000 +0100 +@@ -12,7 +12,11 @@ + } + + templates2events("/etc/pam.d/pop3", "console-save"); +-templates2events("/etc/pam.d/pop3", "bootstrap-console-save"); ++ ++foreach my $file (qw(/etc/pam.d/pop3 /var/service/pop3/env/MEMLIMIT /var/service/pop3s/env/MEMLIMIT)) ++{ ++ templates2events($file, "bootstrap-console-save"); ++} + + foreach my $event (qw(network-delete network-create email-update)) + { +diff -ruN e-smith-pop3-2.2.0.old/root/etc/e-smith/templates/var/service/pop3/env/MEMLIMIT e-smith-pop3-2.2.0/root/etc/e-smith/templates/var/service/pop3/env/MEMLIMIT +--- e-smith-pop3-2.2.0.old/root/etc/e-smith/templates/var/service/pop3/env/MEMLIMIT 1970-01-01 01:00:00.000000000 +0100 ++++ e-smith-pop3-2.2.0/root/etc/e-smith/templates/var/service/pop3/env/MEMLIMIT 2012-07-06 06:36:53.000000000 +0100 +@@ -0,0 +1,7 @@ ++{ ++# memory limit to catch any memory leak before it kills the system ++my $MIN_MEMORY_LIMIT = 40000000; ++ ++# The MIN_MEMORY_LIMIT is returned unless the DB variable is defined and greater than MIN_MEMORY_LIMIT ++$OUT = (not defined ($pop3{MemLimit})) || ($pop3{MemLimit} < $MIN_MEMORY_LIMIT) ? $MIN_MEMORY_LIMIT : $pop3{MemLimit}; ++} +diff -ruN e-smith-pop3-2.2.0.old/root/etc/e-smith/templates/var/service/pop3s/env/MEMLIMIT e-smith-pop3-2.2.0/root/etc/e-smith/templates/var/service/pop3s/env/MEMLIMIT +--- e-smith-pop3-2.2.0.old/root/etc/e-smith/templates/var/service/pop3s/env/MEMLIMIT 1970-01-01 01:00:00.000000000 +0100 ++++ e-smith-pop3-2.2.0/root/etc/e-smith/templates/var/service/pop3s/env/MEMLIMIT 2012-07-06 06:38:21.000000000 +0100 +@@ -0,0 +1,7 @@ ++{ ++# memory limit to catch any memory leak before it kills the system ++my $MIN_MEMORY_LIMIT = 40000000; ++ ++# The MIN_MEMORY_LIMIT is returned unless the DB variable is defined and greater than MIN_MEMORY_LIMIT ++$OUT = (not defined ($pop3s{MemLimit})) || ($pop3s{MemLimit} < $MIN_MEMORY_LIMIT) ? $MIN_MEMORY_LIMIT : $pop3s{MemLimit}; ++} diff -ruN e-smith-pop3-2.2.0.old/root/var/service/pop3/run e-smith-pop3-2.2.0/root/var/service/pop3/run ---- e-smith-pop3-2.2.0.old/root/var/service/pop3/run 2012-07-03 03:56:22.000000000 +0100 -+++ e-smith-pop3-2.2.0/root/var/service/pop3/run 2012-07-03 04:16:08.000000000 +0100 +--- e-smith-pop3-2.2.0.old/root/var/service/pop3/run 2012-07-06 05:38:19.000000000 +0100 ++++ e-smith-pop3-2.2.0/root/var/service/pop3/run 2012-07-06 06:32:30.000000000 +0100 @@ -3,11 +3,12 @@ hostname=$(/sbin/e-smith/config get SystemName) domain=$(/sbin/e-smith/config get DomainName) fqdn="$hostname.$domain" -+Softlimit=$(/sbin/e-smith/config getprop pop3 Softlimit) ++MEM="`head -1 ./env/MEMLIMIT`" exec 2>&1 # Generate ACL files in ./peers ./control/1 -exec /usr/local/bin/softlimit -m 10000000 \ -+exec /usr/local/bin/softlimit -m $Softlimit \ ++exec /usr/local/bin/softlimit -m ${MEM} \ tcpsvd \ -v \ -i ./peers \ diff -ruN e-smith-pop3-2.2.0.old/root/var/service/pop3s/run e-smith-pop3-2.2.0/root/var/service/pop3s/run ---- e-smith-pop3-2.2.0.old/root/var/service/pop3s/run 2012-07-03 03:56:22.000000000 +0100 -+++ e-smith-pop3-2.2.0/root/var/service/pop3s/run 2012-07-03 04:16:07.000000000 +0100 +--- e-smith-pop3-2.2.0.old/root/var/service/pop3s/run 2012-07-06 05:38:19.000000000 +0100 ++++ e-smith-pop3-2.2.0/root/var/service/pop3s/run 2012-07-06 06:32:19.000000000 +0100 @@ -3,9 +3,10 @@ hostname=$(/sbin/e-smith/config get SystemName) domain=$(/sbin/e-smith/config get DomainName) fqdn="$hostname.$domain" -+Softlimit=$(/sbin/e-smith/config getprop pop3s Softlimit) ++MEM="`head -1 ./env/MEMLIMIT`" exec 2>&1 -exec /usr/local/bin/softlimit -m 10000000 \ -+exec /usr/local/bin/softlimit -m $Softlimit \ ++exec /usr/local/bin/softlimit -m ${MEM} \ tcpsvd \ -v \ -i ./peers \