summaryrefslogtreecommitdiffstats
path: root/abs/mv-core/runit-scripts-mv/runitscripts
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2008-12-05 19:17:48 (GMT)
committerJames Meyer <james.meyer@operamail.com>2008-12-05 19:17:48 (GMT)
commit0cc1080dee0c081423deffca0884193011ea399b (patch)
tree138395cfe31c980d90211f692b77bda25fecdbd3 /abs/mv-core/runit-scripts-mv/runitscripts
parent9c63001e5eb322bf73aed1541884027f422ff480 (diff)
downloadlinhes_pkgbuild-0cc1080dee0c081423deffca0884193011ea399b.zip
linhes_pkgbuild-0cc1080dee0c081423deffca0884193011ea399b.tar.gz
linhes_pkgbuild-0cc1080dee0c081423deffca0884193011ea399b.tar.bz2
add better error checking for the init scripts ncidd/xvfb/evrouter
Diffstat (limited to 'abs/mv-core/runit-scripts-mv/runitscripts')
-rwxr-xr-xabs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/finish10
-rwxr-xr-xabs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/run12
-rw-r--r--abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/supervise/lock0
-rw-r--r--abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/supervise/pid0
-rw-r--r--abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/supervise/stat1
-rw-r--r--abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/supervise/statusbin20 -> 0 bytes
-rw-r--r--abs/mv-core/runit-scripts-mv/runitscripts/services/ncid/finish9
-rwxr-xr-xabs/mv-core/runit-scripts-mv/runitscripts/services/ncid/run11
-rw-r--r--abs/mv-core/runit-scripts-mv/runitscripts/services/ncidd/finish9
-rwxr-xr-xabs/mv-core/runit-scripts-mv/runitscripts/services/ncidd/run6
10 files changed, 50 insertions, 8 deletions
diff --git a/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/finish b/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/finish
index 0dd33de..5ebda4c 100755
--- a/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/finish
+++ b/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/finish
@@ -1,4 +1,10 @@
#!/bin/bash
. /etc/profile
-DISPLAY=localhost:50 evrouter -q
-rm -rf /tmp/.evrouter*
+which evrouter >/dev/null 2>/dev/null
+if [ $? = 0 ]
+then
+ DISPLAY=localhost:50 evrouter -q
+ rm -rf /tmp/.evrouter*
+else
+ sv down evrouter
+fi \ No newline at end of file
diff --git a/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/run b/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/run
index 1d7389a..5697f6f 100755
--- a/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/run
+++ b/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/run
@@ -1,5 +1,13 @@
#!/bin/bash
. /etc/profile
-sv start Xvfb
-su mythtv -c "DISPLAY=localhost:50 evrouter -c /etc/evrouter.cfg -f /dev/input/event*"
+which evrouter >/dev/null 2>/dev/null
+if [ $? = 0 ]
+then
+ ps -ef |grep -v grep|grep -q "Xvfb :50"
+ if [ ! $? = 0 ]
+ then
+ sv start Xvfb
+ fi
+ su mythtv -c "DISPLAY=localhost:50 evrouter -c /etc/evrouter.cfg -f /dev/input/event*"
+fi
diff --git a/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/supervise/lock b/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/supervise/lock
deleted file mode 100644
index e69de29..0000000
--- a/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/supervise/lock
+++ /dev/null
diff --git a/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/supervise/pid b/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/supervise/pid
deleted file mode 100644
index e69de29..0000000
--- a/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/supervise/pid
+++ /dev/null
diff --git a/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/supervise/stat b/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/supervise/stat
deleted file mode 100644
index eb0e904..0000000
--- a/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/supervise/stat
+++ /dev/null
@@ -1 +0,0 @@
-down
diff --git a/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/supervise/status b/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/supervise/status
deleted file mode 100644
index 742989c..0000000
--- a/abs/mv-core/runit-scripts-mv/runitscripts/services/evrouter/supervise/status
+++ /dev/null
Binary files differ
diff --git a/abs/mv-core/runit-scripts-mv/runitscripts/services/ncid/finish b/abs/mv-core/runit-scripts-mv/runitscripts/services/ncid/finish
new file mode 100644
index 0000000..953a4a1
--- /dev/null
+++ b/abs/mv-core/runit-scripts-mv/runitscripts/services/ncid/finish
@@ -0,0 +1,9 @@
+#!/bin/bash
+exec 2>&1
+which ncid 2>/dev/null >/dev/null
+if [ ! $? = 0 ]
+then
+ sv down ncid
+fi
+
+
diff --git a/abs/mv-core/runit-scripts-mv/runitscripts/services/ncid/run b/abs/mv-core/runit-scripts-mv/runitscripts/services/ncid/run
index 8a90707..7dbc8ba 100755
--- a/abs/mv-core/runit-scripts-mv/runitscripts/services/ncid/run
+++ b/abs/mv-core/runit-scripts-mv/runitscripts/services/ncid/run
@@ -1,5 +1,12 @@
#!/bin/sh
exec 2>&1
-sv start ncidd
-exec /usr/bin/ncid --no-gui --all --call-prog --program /usr/bin/ncid.py 127.0.0.1 3333
+which ncid 2>/dev/null >/dev/null
+if [ $? = 0 ]
+then
+ if [ -f /var/service/ncidd/run ]
+ then
+ sv start ncidd
+ fi
+ exec /usr/bin/ncid --no-gui --all --call-prog --program /usr/bin/ncid.py 127.0.0.1 3333
+fi
diff --git a/abs/mv-core/runit-scripts-mv/runitscripts/services/ncidd/finish b/abs/mv-core/runit-scripts-mv/runitscripts/services/ncidd/finish
new file mode 100644
index 0000000..ab39d39
--- /dev/null
+++ b/abs/mv-core/runit-scripts-mv/runitscripts/services/ncidd/finish
@@ -0,0 +1,9 @@
+#!/bin/bash
+exec 2>&1
+which ncidd 2>/dev/null >/dev/null
+if [ ! $? = 0 ]
+then
+ sv down ncid
+fi
+
+
diff --git a/abs/mv-core/runit-scripts-mv/runitscripts/services/ncidd/run b/abs/mv-core/runit-scripts-mv/runitscripts/services/ncidd/run
index 6b032db..f1c710a 100755
--- a/abs/mv-core/runit-scripts-mv/runitscripts/services/ncidd/run
+++ b/abs/mv-core/runit-scripts-mv/runitscripts/services/ncidd/run
@@ -1,3 +1,7 @@
#!/bin/sh
exec 2>&1
-exec /usr/sbin/ncidd -D 2>&1
+which ncidd > /dev/null 2>/dev/null
+if [ $? = 0 ]
+then
+ exec /usr/sbin/ncidd -D 2>&1
+fi