summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xabs/core/runit-scripts/PKGBUILD2
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/mythdroid/finish9
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/mythdroid/run16
3 files changed, 26 insertions, 1 deletions
diff --git a/abs/core/runit-scripts/PKGBUILD b/abs/core/runit-scripts/PKGBUILD
index 877fe18..b58966d 100755
--- a/abs/core/runit-scripts/PKGBUILD
+++ b/abs/core/runit-scripts/PKGBUILD
@@ -1,6 +1,6 @@
pkgname=runit-scripts
pkgver=2.1.1
-pkgrel=49
+pkgrel=50
pkgdesc="collection of startup scripts for runit"
url="http://smarden.org/runit/"
license="BSD"
diff --git a/abs/core/runit-scripts/runitscripts/services/mythdroid/finish b/abs/core/runit-scripts/runitscripts/services/mythdroid/finish
new file mode 100755
index 0000000..c3d8b6b
--- /dev/null
+++ b/abs/core/runit-scripts/runitscripts/services/mythdroid/finish
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+[ -f /etc/conf.d/mdd.conf ] && . /etc/conf.d/mdd.conf
+
+ PID=$(pidof -o %PPID -x /usr/bin/vendor_perl/mdd.pl)
+ [[ -n $PID ]] && kill $PID &> /dev/null
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