[mythtv-users] Watchdog ?

Scott list-mythtv at bluecamel.eml.cc
Wed Mar 28 02:36:47 UTC 2007


On Mar 27, 2007, at 10:07 PM, Daniel Agar wrote:

>> Warpme wrote:
>>> Hi *
>>>
>>> Has some brave soul developed watchdog solution for crashing FE ?
>> better yet, follow the instructions in the documentation for how to
>> debug MythTV and capture a backgrate of what is causing your  
>> frontend to
>> crash so it can be fixed rather than working around it.


Here's what I do for my BE on gentoo. It's rare that it's needed  
these days though.

#!/bin/bash
# abort if mythtv pid file doesn't exist
PIDFILE="/var/run/mythbackend.pid"
if [ ! -e $PIDFILE ] ; then
     exit 0;
fi;
# pid number and count of mythbackend procs running
PID=$(cat ${PIDFILE});
PROCCOUNT=$(ps -eo pid,comm | grep "${PID} mythbackend" | wc -l);
if [ $PROCCOUNT -ne 1 ] ; then
    logger -t $(basename $0) "mythbackend pid ${PID} appears to have  
died";
    /etc/init.d/mythbackend restart;
fi


--
Scott 


More information about the mythtv-users mailing list