summaryrefslogtreecommitdiffstats
path: root/abs/core/runit-scripts/runitscripts/services/mythdroid/run
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2012-01-26 02:23:03 (GMT)
committerJames Meyer <james.meyer@operamail.com>2012-01-26 02:23:54 (GMT)
commit8dccaace9c7f36aa3513639b67a18c331548714b (patch)
treed182682165012ef48108d7b3358c26a00be86099 /abs/core/runit-scripts/runitscripts/services/mythdroid/run
parent55b3626309830e1301dcd66e5755a8ab2b59a4a1 (diff)
downloadlinhes_pkgbuild-8dccaace9c7f36aa3513639b67a18c331548714b.zip
linhes_pkgbuild-8dccaace9c7f36aa3513639b67a18c331548714b.tar.gz
linhes_pkgbuild-8dccaace9c7f36aa3513639b67a18c331548714b.tar.bz2
runit-scripts: add back mythdroid scripts by mihanson.7.2
Diffstat (limited to 'abs/core/runit-scripts/runitscripts/services/mythdroid/run')
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/mythdroid/run16
1 files changed, 16 insertions, 0 deletions
diff --git a/abs/core/runit-scripts/runitscripts/services/mythdroid/run b/abs/core/runit-scripts/runitscripts/services/mythdroid/run
new file mode 100755
index 0000000..fa2cb48
--- /dev/null
+++ b/abs/core/runit-scripts/runitscripts/services/mythdroid/run
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+[ -f /etc/conf.d/mdd.conf ] && . /etc/conf.d/mdd.conf
+
+ stat_runit "Starting MythDroid daemon"
+
+ /sbin/chpst -u mythtv /usr/bin/vendor_perl/mdd.pl
+ PID=$(pidof -o %PPID -x /usr/bin/vendor_perl/mdd.pl)
+
+# Wait until daemon dies, else runit can't supervise us
+ while [ "`pidof -o %PPID -x /usr/bin/vendor_perl/mdd.pl`" == "$PID" ]; do
+ sleep 2
+ done