summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/linhes-scripts/pause-mythcommflag.sh
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2010-10-23 18:17:40 (GMT)
committerJames Meyer <james.meyer@operamail.com>2010-10-23 18:19:39 (GMT)
commitadbcf19958300e9b6598990184c8815b945ba0ee (patch)
treef4283c850ac0ac202c17e78a637ee7ca8147621b /abs/core-testing/linhes-scripts/pause-mythcommflag.sh
parent61a68250df10d29b624650948484898334ff22d0 (diff)
downloadlinhes_pkgbuild-adbcf19958300e9b6598990184c8815b945ba0ee.zip
linhes_pkgbuild-adbcf19958300e9b6598990184c8815b945ba0ee.tar.gz
linhes_pkgbuild-adbcf19958300e9b6598990184c8815b945ba0ee.tar.bz2
Removed old core and extra from repo. Renamed -testing to core/extra. This will setup the base for the testing branch.
Diffstat (limited to 'abs/core-testing/linhes-scripts/pause-mythcommflag.sh')
-rwxr-xr-xabs/core-testing/linhes-scripts/pause-mythcommflag.sh53
1 files changed, 0 insertions, 53 deletions
diff --git a/abs/core-testing/linhes-scripts/pause-mythcommflag.sh b/abs/core-testing/linhes-scripts/pause-mythcommflag.sh
deleted file mode 100755
index 4da808b..0000000
--- a/abs/core-testing/linhes-scripts/pause-mythcommflag.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-# pause-mythcommflag.sh v0.2 05/21/09
-# Utility to automatically pause & unpause mythcommflag if CPU usage is above a certain level
-# Free for any use.
-# Installation:
-# cp pause-mythcommflag.sh /usr/LH/bin
-# chmod +x /usr/LH/bin/pause-mythcommflag.sh
-# Usage: Executed from sv start pause-mythcommflag
-
-# Threshold for when mythcommflag will be paused
-CPUTHRESHOLD=75
-
-# Second Threshold for when mythcommflag is already paused
-PAUSEDCPUTHRESHOLD=45
-
-# Log file to write (change to /dev/null for no log)
-LOG=/var/log/mythtv/pause-mythcommflag.log
-
-# Number of seconds to wait between checking for mythcommflag process
-SLEEP=5
-
-#sleep $SLEEP
-
-touch $LOG
-
-COMMFLAGSTATE=1
-
-while true; do
- PROCCOMMFLAG=`pidof mythcommflag`
- if [ -n "${PROCCOMMFLAG}" ]
- then
- FRONTENDCPU=`top -bn1u mythtv | grep mythfrontend | awk '{ print $9 }'`
- if [ $COMMFLAGSTATE -eq 1 ]
- then
- CPUTHRESHOLD1=$CPUTHRESHOLD
- else
- CPUTHRESHOLD1=$PAUSEDCPUTHRESHOLD
- fi
- if [ "$FRONTENDCPU" -ge "$CPUTHRESHOLD1" ]
- then
-# echo "$(date) FE CPU $FRONTENDCPU% is greater than $CPUTHRESHOLD1%, PAUSE Commflagging" >> $LOG
- kill -s STOP $PROCCOMMFLAG
- COMMFLAGSTATE=0
- else
-# echo "$(date) FE CPU $FRONTENDCPU% is less than $CPUTHRESHOLD1%, CONTINUE Commflagging" >> $LOG
- kill -s CONT $PROCCOMMFLAG
- COMMFLAGSTATE=1
- fi
-# else
-# echo "No COMMFLAG Process Active" >> $LOG
- fi
- sleep $SLEEP
-done