summaryrefslogtreecommitdiffstats
path: root/abs/core/runit-scripts
diff options
context:
space:
mode:
authorMichael Hanson <hansonorders@verizon.net>2011-01-04 01:19:36 (GMT)
committerMichael Hanson <hansonorders@verizon.net>2011-01-04 01:19:36 (GMT)
commit2cae18b3f848454632c564386a2055d26373f42c (patch)
treef6022582e6cc03963ce8fbfe4de6f48ba911c6ad /abs/core/runit-scripts
parent9dd56269ce4d6d2b4bb6785bb46a36476064b442 (diff)
parent1e9dea8744ac41a9ddd5356afa19ea453c6e4855 (diff)
downloadlinhes_pkgbuild-2cae18b3f848454632c564386a2055d26373f42c.zip
linhes_pkgbuild-2cae18b3f848454632c564386a2055d26373f42c.tar.gz
linhes_pkgbuild-2cae18b3f848454632c564386a2055d26373f42c.tar.bz2
Merge branch 'testing' of knoppmyth.net:linhes_pkgbuild into testing
Diffstat (limited to 'abs/core/runit-scripts')
-rwxr-xr-xabs/core/runit-scripts/PKGBUILD2
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/lircd/run13
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/mythbackend/finish36
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/mythbackend/run4
4 files changed, 46 insertions, 9 deletions
diff --git a/abs/core/runit-scripts/PKGBUILD b/abs/core/runit-scripts/PKGBUILD
index 39368bb..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=12
+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/lircd/run b/abs/core/runit-scripts/runitscripts/services/lircd/run
index 3ff8af3..e0d468e 100755
--- a/abs/core/runit-scripts/runitscripts/services/lircd/run
+++ b/abs/core/runit-scripts/runitscripts/services/lircd/run
@@ -31,6 +31,7 @@ else
stat_runit "Starting lirc"
[ -e /etc/sv/lircd/.runtime ] || mkdir -p /etc/sv/lircd/.runtime
+ [ -e /var/run/lirc ] || mkdir -p /var/run/lirc
function dvico_detect {
if [ x$Remotetype = "xdvico" ] || [ x$Remotetype = "xDvico-Dual-Digital4-rev2" ]
@@ -108,7 +109,7 @@ else
for i in `seq 1 $num_lirc`
do
- CMD="/usr/sbin/lircd -r -d /dev/lirc$i --output=/dev/lircd$i --pidfile=/var/run/lircd$i.pid --listen=876$i"
+ CMD="/usr/sbin/lircd -r -d /dev/lirc$i --output=/var/run/lirc/lircd$i --pidfile=/var/run/lircd$i.pid --listen=876$i"
printhl " Device $i"
#echo $CMD
$CMD >>$LOG 2>>$LOG
@@ -119,9 +120,9 @@ else
then
if [ x$Remotetype = "xdvico" ]
then
- LCMD="/usr/sbin/lircd -r -n -d /dev/usb/dvicoIR --driver=dvico --output /dev/lircd"
+ LCMD="/usr/sbin/lircd -r -n -d /dev/usb/dvicoIR --driver=dvico --output /var/run/lirc/lircd"
else
- LCMD="/usr/sbin/lircd -r -n -d /dev/input/irremote --driver=devinput --output /dev/lircd"
+ LCMD="/usr/sbin/lircd -r -n -d /dev/input/irremote --driver=devinput --output /var/run/lirc/lircd"
fi
if [ $num_lirc -lt 0 ]
@@ -133,14 +134,14 @@ else
elif [ $num_lirc -gt -1 ]
then
i=$((i+1))
- CMD="$LCMD --output=/dev/lircd$i --pidfile=/var/run/lircd$i.pid --listen=876$i"
+ CMD="$LCMD --output=/var/run/lirc/lircd$i --pidfile=/var/run/lircd$i.pid --listen=876$i"
$CMD >> $LOG
LASTCMD="--connect=localhost:876$i $LASTCMD "
printhl " Device Dvico"
- /usr/sbin/lircd -r -n -d /dev/lirc0 --output /dev/lircd $LASTCMD >>$LOG 2>>$LOG
+ /usr/sbin/lircd -r -n -d /dev/lirc0 --output /var/run/lirc/lircd $LASTCMD >>$LOG 2>>$LOG
fi
else
- LCMD="/usr/sbin/lircd -r -n -d /dev/lirc0 --output /dev/lircd $LASTCMD"
+ LCMD="/usr/sbin/lircd -r -n -d /dev/lirc0 --output /var/run/lirc/lircd $LASTCMD"
#echo $LCMD
exec $LCMD >>$LOG 2>>$LOG
fi
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"