summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/runit/runitscripts/services/frontend
diff options
context:
space:
mode:
authorJames Meyer <James.meyer@operamail.com>2008-10-02 03:19:12 (GMT)
committerJames Meyer <James.meyer@operamail.com>2008-10-02 03:19:12 (GMT)
commit0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a (patch)
treec0aa2c0b53c317be87eacfcb77b63f53f1f415e7 /abs/core-testing/runit/runitscripts/services/frontend
downloadlinhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.zip
linhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.tar.gz
linhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.tar.bz2
initial import
Diffstat (limited to 'abs/core-testing/runit/runitscripts/services/frontend')
-rwxr-xr-xabs/core-testing/runit/runitscripts/services/frontend/finish30
-rwxr-xr-xabs/core-testing/runit/runitscripts/services/frontend/log/run5
-rwxr-xr-xabs/core-testing/runit/runitscripts/services/frontend/run10
3 files changed, 45 insertions, 0 deletions
diff --git a/abs/core-testing/runit/runitscripts/services/frontend/finish b/abs/core-testing/runit/runitscripts/services/frontend/finish
new file mode 100755
index 0000000..e1e3e00
--- /dev/null
+++ b/abs/core-testing/runit/runitscripts/services/frontend/finish
@@ -0,0 +1,30 @@
+#!/bin/bash
+exec 2>&1
+grep -q nox /proc/cmdline
+STATUS=$?
+ if [ $STATUS = 0 ]
+ then
+ chvt 2
+else
+
+chvt 1
+if [ ! -d /etc/sv/frontend/.runtime ]
+then
+ mkdir -p /etc/sv/frontend/.runtime
+fi
+
+touch /etc/sv/frontend/.runtime/`date +%s`
+sleep 0.2
+ps -U mythtv -ef |grep "/bin/sh /usr/bin/startx"|grep -v grep|awk ' { print $2 } '|xargs kill -9 2> /dev/null
+
+
+cdate=`date`
+numfiles=`/usr/bin/file_time_offset.py -s10 -d/etc/sv/frontend/.runtime`
+
+if [ $numfiles -gt 2 ]
+then
+ sv stop frontend
+ rm -f /etc/sv/frontend/.runtime/*
+ echo "Frontend is not able to start, disabling it"
+fi
+fi
diff --git a/abs/core-testing/runit/runitscripts/services/frontend/log/run b/abs/core-testing/runit/runitscripts/services/frontend/log/run
new file mode 100755
index 0000000..463045f
--- /dev/null
+++ b/abs/core-testing/runit/runitscripts/services/frontend/log/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+exec 2>&1
+. /etc/systemconfig
+ /usr/bin/logger -p local6.info -t mythfrontend
+
diff --git a/abs/core-testing/runit/runitscripts/services/frontend/run b/abs/core-testing/runit/runitscripts/services/frontend/run
new file mode 100755
index 0000000..b59fc63
--- /dev/null
+++ b/abs/core-testing/runit/runitscripts/services/frontend/run
@@ -0,0 +1,10 @@
+#!/bin/sh
+exec 2>&1
+ grep -q nox /proc/cmdline
+ STATUS=$?
+ if [ $STATUS = 0 ]
+ then
+ sv down frontend
+ exit 0
+ fi
+/usr/bin/openvt -fwc 6 -- /bin/su - mythtv -c /usr/bin/startx >& /dev/null