diff options
Diffstat (limited to 'abs/core/runit-scripts/runitscripts/services/mythbackend')
-rwxr-xr-x | abs/core/runit-scripts/runitscripts/services/mythbackend/run | 59 |
1 files changed, 50 insertions, 9 deletions
diff --git a/abs/core/runit-scripts/runitscripts/services/mythbackend/run b/abs/core/runit-scripts/runitscripts/services/mythbackend/run index 273f655..903979c 100755 --- a/abs/core/runit-scripts/runitscripts/services/mythbackend/run +++ b/abs/core/runit-scripts/runitscripts/services/mythbackend/run @@ -4,9 +4,30 @@ exec 2>&1 export TERM=linux . /etc/rc.conf . /etc/rc.d/functions + +#Run autocard +if [ ! -e /etc/udev/mv-persistent-video.description ] +then + /usr/MythVantage/bin/autocard.py insertdb >/tmp/autocard.log & +fi + +#wait for mysql +if [ -e /service/mysql ] +then + /sbin/svwaitup -s 10 /service/mysql +fi + +if [ -e /service/avahi ] +then + /sbin/svwaitup -s 2 /service/avahi +fi + #profile is here to setup LC_ALL/locale MYTH_RUN_STATUS="1" -. /etc/profile +. /etc/profile + +MYTH_ARGS="-q --syslog local6" +[ -f /etc/conf.d/mythbackend ] && . /etc/conf.d/mythbackend stat_runit "Scanning for new storage" @@ -23,13 +44,13 @@ then fi -stat_runit "Starting MythBackend" + + + + + + export HOME=/root -if [ ! x$SystemType = xSlave_backend ] -then - sv start mysql > /dev/null 2>/dev/null -fi -#echo "Starting mythbackend" # if [ -f /tmp/debug ] # then # echo "using gbd/debug" @@ -39,11 +60,31 @@ fi # chown mythtv:mythtv /data/home/mythtv/gdb.txt.mythbackend # sleep 10 # -# else +# else + if [ x"$SystemType" = "xSlave_backend" ] + then + #do init check + MYTHCONFDIR=/usr/share/mythtv /usr/LH/bin/be_check.py + rc=$? + while [ $rc -ne 0 ] + do + #msg "Waiting for connection to MythBackend" + echo " * Waiting for connection to primary MythBackend" + MYTHCONFDIR=/usr/share/mythtv /usr/LH/bin/be_check.py + rc=$? + sleep 6 + done + stat_runit "Starting Slave MythBackend" + else + stat_runit "Starting Primary MythBackend" + fi + + + if pacman -Q mythtv | grep -q 0.24 then exec su mythtv -c "/usr/bin/mythbackend --logfile /var/log/mythtv/mythbackend.log" else - exec su mythtv -c "/usr/bin/mythbackend -q --syslog local6" + exec su mythtv -c "/usr/bin/mythbackend -q --syslog local6" fi # fi |