aboutsummaryrefslogtreecommitdiffstats
path: root/modules/viewvc/templates/kill_viewvc.sh
blob: 8c33c2ff3f258abdd195fd14d3fb5a742c151ef7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/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