LinHES Forums
http://forums.linhes.org/

My mythbackend babysitting script - babysit_backend.sh
http://forums.linhes.org/viewtopic.php?f=3&t=13613
Page 3 of 4

Author:  thornsoft [ Fri Feb 02, 2007 11:59 am ]
Post subject:  Re: it's working

neutron68 wrote:
I can see that it is working. Now, I'm surprised that the backend hasn't been disconnecting on me, like it has with others.

Consider yourself lucky! For me, it was about 50/50 whether it would come up ok after a reboot, and then I've historically had the backend go down about once every 2-3 weeks, just out of the blue, since I started using Myth in 2005. So this gives me extra peace of mind.

Author:  neutron68 [ Sat Feb 03, 2007 12:41 pm ]
Post subject:  disconnections

thornsoft wrote wrote:
Consider yourself lucky! For me, it was about 50/50 whether it would come up ok after a reboot, and then I've historically had the backend go down about once every 2-3 weeks, just out of the blue, since I started using Myth in 2005. So this gives me extra peace of mind.


Whoa! You've been having backend disconnections on and off since 2005?? I thought the disconnections were new to R5E50. R5E50 is when I started getting them. When they happened to me, my whole Mythtv computer would lock up and when I rebooted, I believe the database was corrupted so I was fixing the database after every reboot and then manually launching the backend.

As I type this, I just discovered that my Myth computer just locked up and now I'm rebooting... $$#&^%$#!!!

So, it looks like the babysitting scirpt is running, but it isn't going to work if the machine locks up....crap.

Author:  neutron68 [ Sun Feb 04, 2007 6:30 pm ]
Post subject:  what happens if...?

So, what happens if a recording starts and then backend disconnects?

I would guess that the babysitter script will run and then the recording will restart - with the same filename as before and all the program up to the disconnection, will be overwritten. Is that correct?

Can someone verify that this is an R5E50 problem, only?

Eric

Author:  mjl [ Sun Feb 04, 2007 8:49 pm ]
Post subject: 

Hi thornsoft,

I rarely have backend issues, however I do get the frontend to drop out sometimes when switching around in the menus and it is always at an inopportune time :) Usually happens when I exit music to go view a movie/recording. Have you made a frontend babysitter script? Sure would save more than one trip to the basement just to hit alt m

Thanks
Mike

Author:  thornsoft [ Sun Feb 04, 2007 10:20 pm ]
Post subject:  Re: what happens if...?

neutron68 wrote:
So, what happens if a recording starts and then backend disconnects?

My experience is that it'll continue recording, using a slightly different filename. I haven't looked to see what the difference is, but suspect that it's got a different timestamp in the name. I definitely have re-started the backend mid-recording, or rebooted the PC, and you end up with two parts to the show. You can easily test - record something that you don't care about, alt+2 to kill the backend, restart manually or let the script do it, and you'll see.

Author:  thornsoft [ Sun Feb 04, 2007 10:22 pm ]
Post subject: 

mjl wrote:
Have you made a frontend babysitter script?

No, but if you have situations where the frontend quits, you can make your own script. Just change "back" to "front", and there you go.

Author:  mjl [ Sun Feb 04, 2007 11:32 pm ]
Post subject: 

Thanks :)

Author:  tjc [ Sat Feb 24, 2007 1:23 pm ]
Post subject:  CAVEAT UTOR!

Note that you should disable any magic restart script like this during backups and restores. It's a really, really bad idea to have something restarting servers when the backup/restore process has shut them down because it needs the DB in "quiet" state. Also, before the question comes up, because of the potential variety of these restarters, and the mechanism used here in particular, there is no safe easy way for the backup and restore scripts to shut them down. :(

BTW - This is not an academic warning, I'm in the middle of helping some poor soul who got burned by this...

Author:  bigbro [ Sat Feb 24, 2007 7:58 pm ]
Post subject: 

tjc, your comments are well timed and noted.

I absolutely agree you should make sure you stop either of these scripts before you do a backup or other db settings like mythtv-setup.

I have run at least two different Backend monitor scripts that I can recall.
mbemon and babysit_backend, there was another one, but I immediately pulled it didn't like the way it worked and didn't seem as effective.

Just a couple of quick observations regarding the two.
Both seem to do an equally proper job of restarting the Backend if it is down.

They do however differ in function from what I have seen.

mbemon - This script seems to only look for the Backend being down and will restart it. If you are doing backups or adjusting settings in mythtv-setup abosultely this one must be stopped. I have had it restart the backend in the middle of a mythtv-setup session and scramble the settings. OF course at that point it was too late. Had to completely rebuild the settings.


babysit_backend - This script checks not only for the Backend being down but also checks the status of the frontend before it restarts the backend. Observation, I accidently left it running when I installed and reconfigured a new capture card. It didn't restart the backend until right after I started the Frontend. This was a good thing at the time.

I make it a standard step to always stop the script when I am doing some of those maintenance items mentioned above.

I absolutely agree with you one should make sure they stop these types of scripts. Sometimes I am my own worst enemy on this stuff. Thanks for the reminder.

Regards!
Andy

Author:  mjl [ Sat Feb 24, 2007 8:04 pm ]
Post subject: 

Hi,

Words from the wise are always welcomed :) Mr Thornsoft has taken that into consideration if I can read his script properly and if it does as advertised. His comment in the script is:
#if frontend IS running, and backup/restore setup are NOT running. so that should about cover your point.

I never did modify the script for baby sitting the frontend (days aren't long enough) but just added the restart frontend to my remote power button.

Thanks again for alerting folks to possible side effects with automatic stuff.

Mike

Author:  neutron68 [ Tue Jul 17, 2007 8:27 pm ]
Post subject:  FOUND THE SOURCE OF MY LOCKUPS!

neutron68 wrote:
As I type this, I just discovered that my Myth computer just locked up and now I'm rebooting... $$#&^%$#!!!

It took me a few months of lockups to get REALLY tired of it and hunt down the culpret. It was my Western Digital boot hard drive - made 2001. It was disconnecting itself from the IDE chain and when it did, it would crash the computer! When it locked up I would get a black screen with repetative white dots and lines.
http://www.geocities.com/neutron68/pict ... MG4436.JPG
One theory is that Linux was tring to drop to a command shell and give an error message such as KERNEL PANIC after the drive errored but the machine locked up in the process and the error message never got displayed.

To fix the system, I used Acronis True Image 10 to clone the failing boot drive over to another drive. Thus I was able to get the failing drive out of the system. With the "new" drive in the system, I've not had a lockup since!

I ran scans of the failing drive using Spinrite 6 and the only errors that showed up were "cabling errors" which I believe are IDE bus errors. During the scans, I could hear the drive motor briefly spin down and spin back up to full speed again. I believe those were the IDE disconnections.

I was surprised, but now I know that a flakey hard drive can cause Knoppmyth to lock up. File that little tidbit in your troubleshooting folder for future reference. :)

Best wishes, all!
Eric

Author:  davej45 [ Wed Sep 12, 2007 3:31 am ]
Post subject:  Babysitting R5F27?

Anybody know if R5F27 will need this script?

I know I HAD to use it on R5E50...

DaveJ45

Author:  thornsoft [ Wed Sep 12, 2007 5:25 am ]
Post subject:  Re: Babysitting R5F27?

davej45 wrote:
Anybody know if R5F27 will need this script?

I'm still on R5E50, but will be upgrading this week. I'll let you know if I still think I need it or not.
It seems like someone else wrote another, simpler one, that simply paused commflag if CPU usage was over a certain threshold. That may be more effective.

Author:  cahlfors [ Thu Sep 13, 2007 12:24 pm ]
Post subject: 

:shock:
Quote:
It seems like someone else wrote another, simpler one, that simply paused commflag if CPU usage was over a certain threshold. That may be more effective

Are you saying that commflag is what's wrecking the backend?

I'm on R5F1 and, checking the logs, the babysit script has saved my behind not more than a couple of times, but that's quite enough. I don't have that many...

Thanks for a very useful safeguard! :D

/Chris

Author:  davej45 [ Mon Sep 17, 2007 2:54 am ]
Post subject: 

UPDATE:

R5F27 Backend has been running for 5 days now without the babysitting script, and no apparent events.

Still running one R5E50 frontend, and in the process of upgrading the second FE to R5F27.

(waiting on a new video card, seems I lost the TV output on one of mine. How common is that?)

Copied over the babysit script to the backend just in case I need to activate it, but so far, so good.

Page 3 of 4 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/