I’m using this to limit the number of processes that Ampache spawns. Sometimes, it goes hay-wire.
#!/bin/sh
cmd="$1"
lim="$2"
user="$3" || "www"
numprocs=`ps -U www | grep "$cmd" | wc -l`
echo "Found $numprocs comparing to $lim"
if [ "$numprocs" -gt "$lim" ]; then
echo "found $numprocs processes"
killall aacplusenc
fi
cmd="$1"
lim="$2"
user="$3" || "www"
numprocs=`ps -U www | grep "$cmd" | wc -l`
echo "Found $numprocs comparing to $lim"
if [ "$numprocs" -gt "$lim" ]; then
echo "found $numprocs processes"
killall aacplusenc
fi
Post a Comment