summaryrefslogtreecommitdiffstats
path: root/abs/core/runit-scripts/runitscripts/services/mythdroid/run
diff options
context:
space:
mode:
authorMichael Hanson <mihanson@linhes.org>2012-01-25 22:45:15 (GMT)
committerMichael Hanson <mihanson@linhes.org>2012-01-25 22:45:15 (GMT)
commit9e3312aa14c7e94b95c6cceba4ae8a0610e272c7 (patch)
tree30b795f49b275f4fdf1b39aefdad5c1dfbd0117e /abs/core/runit-scripts/runitscripts/services/mythdroid/run
parent98f897a6b29ef9f3a9c88a0e4d2cf49d5188b6fb (diff)
downloadlinhes_pkgbuild-9e3312aa14c7e94b95c6cceba4ae8a0610e272c7.zip
linhes_pkgbuild-9e3312aa14c7e94b95c6cceba4ae8a0610e272c7.tar.gz
linhes_pkgbuild-9e3312aa14c7e94b95c6cceba4ae8a0610e272c7.tar.bz2
runit-scripts: add mythdroid
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