|
diff -ruN e-smith-base-5.2.0.old/createlinks e-smith-base-5.2.0/createlinks |
|
|
--- e-smith-base-5.2.0.old/createlinks 2013-01-30 05:07:05.000000000 +0000 |
|
|
+++ e-smith-base-5.2.0/createlinks 2013-01-30 05:23:47.000000000 +0000 |
|
|
@@ -19,6 +19,7 @@ |
|
|
/var/lib/dhclient/dhclient-eth1.conf |
|
|
/var/service/wan/pppoe.pppd.conf |
|
|
/var/service/wan/run.pppoe.conf |
|
|
+ /var/service/wan/env.pppoe/PPPD_MLIMIT |
|
|
/etc/ppp/ip-down.local |
|
|
/etc/ppp/ip-up.local |
|
|
)) |
|
|
diff -ruN e-smith-base-5.2.0.old/root/etc/e-smith/templates/var/service/wan/env.pppoe/PPPD_MLIMIT e-smith-base-5.2.0/root/etc/e-smith/templates/var/service/wan/env.pppoe/PPPD_MLIMIT |
|
|
--- e-smith-base-5.2.0.old/root/etc/e-smith/templates/var/service/wan/env.pppoe/PPPD_MLIMIT 1970-01-01 01:00:00.000000000 +0100 |
|
|
+++ e-smith-base-5.2.0/root/etc/e-smith/templates/var/service/wan/env.pppoe/PPPD_MLIMIT 2013-01-30 05:28:36.000000000 +0000 |
|
|
@@ -0,0 +1,18 @@ |
|
|
+{ |
|
|
+ # memory limit to catch any memory leak before it kills the system |
|
|
+ my $MIN_MEMORY_LIMIT = 100000000; |
|
|
+ $OUT = $MIN_MEMORY_LIMIT; |
|
|
+ |
|
|
+ if (defined $pppoe{Mlimit}) |
|
|
+ { |
|
|
+ # If there is a DB variable defined that is less than the minimum memroy limit, delete it. |
|
|
+ if ($pppoe{Mlimit} <= $MIN_MEMORY_LIMIT) |
|
|
+ { |
|
|
+ $DB->get_prop_and_delete('pppoe','Mlimit'); |
|
|
+ } |
|
|
+ else |
|
|
+ { |
|
|
+ $OUT=$pppoe{Mlimit}; |
|
|
+ } |
|
|
+ } |
|
|
+} |
|
1 |
diff -ruN e-smith-base-5.2.0.old/root/etc/e-smith/templates/var/service/wan/run.pppoe.conf/mlimit e-smith-base-5.2.0/root/etc/e-smith/templates/var/service/wan/run.pppoe.conf/mlimit |
diff -ruN e-smith-base-5.2.0.old/root/etc/e-smith/templates/var/service/wan/run.pppoe.conf/mlimit e-smith-base-5.2.0/root/etc/e-smith/templates/var/service/wan/run.pppoe.conf/mlimit |
2 |
--- e-smith-base-5.2.0.old/root/etc/e-smith/templates/var/service/wan/run.pppoe.conf/mlimit 2007-01-27 01:56:31.000000000 +0000 |
--- e-smith-base-5.2.0.old/root/etc/e-smith/templates/var/service/wan/run.pppoe.conf/mlimit 2007-01-27 01:56:31.000000000 +0000 |
3 |
+++ e-smith-base-5.2.0/root/etc/e-smith/templates/var/service/wan/run.pppoe.conf/mlimit 1970-01-01 01:00:00.000000000 +0100 |
+++ e-smith-base-5.2.0/root/etc/e-smith/templates/var/service/wan/run.pppoe.conf/mlimit 2013-01-31 01:23:21.000000000 +0000 |
4 |
@@ -1,5 +0,0 @@ |
@@ -1,5 +1,15 @@ |
5 |
-{ |
{ |
6 |
-# memory limit to catch any memory leak before it kills the system |
-# memory limit to catch any memory leak before it kills the system |
7 |
- my $mlimit = $pppoe{Mlimit} || '25000000'; |
- my $mlimit = $pppoe{Mlimit} || '25000000'; |
8 |
- $OUT = "PPPD_MLIMIT=$mlimit"; |
- $OUT = "PPPD_MLIMIT=$mlimit"; |
9 |
-} |
+ # memory limit to catch any memory leak before it kills the system |
10 |
diff -ruN e-smith-base-5.2.0.old/root/var/service/wan/run.pppoe e-smith-base-5.2.0/root/var/service/wan/run.pppoe |
+ use constant MIN_MEMORY_LIMIT => 100000000; |
11 |
--- e-smith-base-5.2.0.old/root/var/service/wan/run.pppoe 2013-01-30 05:07:05.000000000 +0000 |
+ |
12 |
+++ e-smith-base-5.2.0/root/var/service/wan/run.pppoe 2013-01-30 05:23:35.000000000 +0000 |
+ # If there is a memory limit in the database and it is below the minimum, delete it. |
13 |
@@ -22,11 +22,12 @@ |
+ if (defined $pppoe{Mlimit} && $pppoe{Mlimit} < MIN_MEMORY_LIMIT) |
14 |
exec 2>&1 |
+ { |
15 |
|
+ $DB->get_prop_and_delete('pppoe','Mlimit'); |
16 |
. run.pppoe.conf |
+ delete $pppoe{Mlimit}; |
17 |
+MEM="`head -1 ./env.pppoe/PPPD_MLIMIT`" |
+ } |
18 |
|
+ |
19 |
extaddr=$(/sbin/e-smith/config getprop ExternalInterface IPAddress) |
+ $OUT = "PPPD_MLIMIT="; |
20 |
|
+ $OUT .= $pppoe{Mlimit} || MIN_MEMORY_LIMIT; |
21 |
exec \ |
} |
22 |
- /usr/local/bin/softlimit -m $PPPD_MLIMIT \ |
+ |
|
+ /usr/local/bin/softlimit -m ${MEM} \ |
|
|
/usr/bin/setsid \ |
|
|
/usr/sbin/pppd ${extaddr:+$extaddr:} \ |
|
|
file pppoe.pppd.conf |
|