aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/viewvc/templates/kill_viewvc.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/viewvc/templates/kill_viewvc.sh b/modules/viewvc/templates/kill_viewvc.sh
new file mode 100755
index 00000000..4c27d3f3
--- /dev/null
+++ b/modules/viewvc/templates/kill_viewvc.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+max_memory=1000000
+
+for process in `pgrep viewvc.fcgi`
+do
+ process_mem=$(pmap "$process" | grep total | sed 's/ \+total \+\([[:digit:]]\+\)K/\1/')
+ if [ "$process_mem" -gt "$max_memory" ]
+ then
+ kill -15 "$process"
+ fi
+done
+