diff options
author | James Meyer <jams@linhes.org> | 2011-01-03 21:56:34 (GMT) |
---|---|---|
committer | James Meyer <jams@linhes.org> | 2011-01-03 21:56:34 (GMT) |
commit | 2c98861fb01578139b77030006e1f50ea8f2680c (patch) | |
tree | 64e3d2bdcf8e4ded481fac957e2879f59a7d39e9 /abs/core/runit-scripts | |
parent | 808989e601b8c15612fcf0997c02bc02c3101d85 (diff) | |
download | linhes_pkgbuild-2c98861fb01578139b77030006e1f50ea8f2680c.zip linhes_pkgbuild-2c98861fb01578139b77030006e1f50ea8f2680c.tar.gz linhes_pkgbuild-2c98861fb01578139b77030006e1f50ea8f2680c.tar.bz2 |
runit-scripts: mythbackend
stop the backend from respawning to quickly.
Diffstat (limited to 'abs/core/runit-scripts')
-rwxr-xr-x | abs/core/runit-scripts/PKGBUILD | 2 | ||||
-rwxr-xr-x | abs/core/runit-scripts/runitscripts/services/mythbackend/finish | 36 | ||||
-rwxr-xr-x | abs/core/runit-scripts/runitscripts/services/mythbackend/run | 4 |
3 files changed, 39 insertions, 3 deletions
diff --git a/abs/core/runit-scripts/PKGBUILD b/abs/core/runit-scripts/PKGBUILD index 6f1e24f..56fbebc 100755 --- a/abs/core/runit-scripts/PKGBUILD +++ b/abs/core/runit-scripts/PKGBUILD @@ -1,6 +1,6 @@ pkgname=runit-scripts pkgver=2.1.1 -pkgrel=14 +pkgrel=17 pkgdesc="collection of startup scripts for runit" url="http://smarden.org/runit/" license="BSD" diff --git a/abs/core/runit-scripts/runitscripts/services/mythbackend/finish b/abs/core/runit-scripts/runitscripts/services/mythbackend/finish new file mode 100755 index 0000000..5258f27 --- /dev/null +++ b/abs/core/runit-scripts/runitscripts/services/mythbackend/finish @@ -0,0 +1,36 @@ +#!/bin/bash +exec 2>&1 +export TERM=linux +. /etc/rc.conf +. /etc/rc.d/functions + +function cleanup(){ + rm -f /etc/sv/mythbackend/.runtime/* + printhl " Cleaning up /etc/sv/mythbackend/.runtime/" +} + + +if [ ! -d /etc/sv/mythbackend/.runtime ] + then + mkdir -p /etc/sv/mythbackend/.runtime + fi + touch /etc/sv/mythbackend/.runtime/`date +%s` + sleep 0.2 + cdate=`date` + numfilestotal=`/usr/bin/file_time_offset.py -s0 -d/etc/sv/mythbackend/.runtime` + numfilesover10secondsold=`/usr/bin/file_time_offset.py -s10 -d/etc/sv/mythbackend/.runtime` + numfileslessthan10secondsold=$(($numfilestotal-$numfilesover10secondsold)) + if [ $numfileslessthan10secondsold -gt 4 ] + then + sv stop mythbackend + printhl " mythbackend disabled, due to many restarts." + logger " mythbackend disabled, due to many restarts." + printhl " Run \"sv start mythbackend\" to try again" + + cleanup + else + if [ $numfilestotal -gt 10 ] + then + cleanup + fi + fi
\ No newline at end of file diff --git a/abs/core/runit-scripts/runitscripts/services/mythbackend/run b/abs/core/runit-scripts/runitscripts/services/mythbackend/run index 48c68d3..4bf54fb 100755 --- a/abs/core/runit-scripts/runitscripts/services/mythbackend/run +++ b/abs/core/runit-scripts/runitscripts/services/mythbackend/run @@ -12,8 +12,8 @@ if [ ! x$SystemType = xSlave_backend ] then sv start mysql > /dev/null 2>/dev/null #run mythfilldatabase - printhl " Running mythfilldatabase" - /usr/MythVantage/bin/initial_db_run & + #printhl " Running mythfilldatabase" + #/usr/MythVantage/bin/initial_db_run & fi mkfifo /tmp/mbefifo >/dev/null 2>/dev/null #echo "Starting mythbackend" |