#!/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