Ideas and Comments about how to get things done
I’ve been running a simple cron task every minute to restart my mythtv backend if it crashes but it wasn’t good enough. I tried using monit but it seems to think the backend is down when it is not and restarts it several times during a recording.
This post from the knoppmyth forums includes a nice script to take care of this along with instructions:
Exceptions:
You can easily extend it to add exceptions too.
Installation:
From a directory such as /tmp, as root:
Code:
wget http://www.thornsoft.com/Misc/babysit_backend.sh
cp babysit_backend.sh /usr/local/bin
chmod +x /usr/local/bin/babysit_backend.sh
run: babysit_backend.sh
It should exit with no messages, if the backend is running. Otherwise it’ll restart it.
Suggested usage - add this line to crontab:
Code:
* * * * * /usr/local/bin/babysit_backend.sh >>/var/log/mythtv/babysit_backend.log 2>&1
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Mar | ||||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | |||
22 queries. 0.157 seconds