[mythtv-users] No connection to the backend (~every two weeks) -- Need help

Allen Edwards allen.p.edwards at gmail.com
Thu Aug 20 08:35:27 UTC 2009


oops.  my previous post was in another thread.  Sorry. I copied it
below:  Do you think this is good or do I need to learn monti?

Allen


-------------------------------------------------------------------------------------------------------------------------
I found this and wonder if this is this a good way?

Put this in /etc/cron:
# Run every minute and restart mythbackend if it has crashed

* * * * * root /usr/bin/mythmon

and this in /usr/bin with "sudo chmod 755 /usr/bin/mythmon"

#!/bin/bash
LOG=/var/log/mythtv/mythbackend.log

date "+%Y-%m-%d %H:%M:%S Checking" >> /tmp/mythmon.log

if ! ps -ef | grep [m]ythbackend >/dev/null; then

 # Check whether setup utility is running
 if ps -ef | grep [m]ythtv-setup >/dev/null; then
   date "+%Y-%m-%d %H:%M:%S mythtv-setup running" >> /tmp/mythmon.log
   exit 0
 fi

 # Mythbackend has crashed, log and restart
 date "+%Y-%m-%d %H:%M:%S Crash detected - restarting mythbackend" >> $LOG
 date "+%Y-%m-%d %H:%M:%S Crash detected - restarting mythbackend" >>
/tmp/mythmon.log
 chown mythtv:mythtv $LOG
 /etc/init.d/mythtv-backend restart
fi


More information about the mythtv-users mailing list