[mythtv-users] Monitt and Mythweb

Brian Walter blwalter at gmail.com
Thu May 10 17:35:06 UTC 2007


Dave Ansell wrote:
> ----- Original Message ----- 
> From: "Brian L. Walter" <blwalter at gmail.com>
> To: "Discussion about mythtv" <mythtv-users at mythtv.org>
> Sent: Sunday, May 06, 2007 2:13 AM
> Subject: [mythtv-users] Monitt and Mythweb
>
>
> Greetings,
>
> I think I have monit configured and running correctly.  One or two tests 
> of killing mythbackend, and monit restarts it very nicely.
>
> However, I've notice than when I try to connect to certain parts of 
> mythweb (status - recorded programs), mythweb hangs for a bit, then, the 
> dreaded "Is the backend running?"..
>
> Monitory the logs, I see a restart of the backend occuring...no erros, 
> no nothing.  I can reliably get it to fail by having monit running, 
> then, access the backend status via mythweb.
>
> Anyone else seeing this?  And if so, is there solution that I'm missing?
>
> TIA
> Brian
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>
>
> Brian,
>
>      My monit script is below.  I havent had any such problems ....
>
>
> ###############  Myth Backend ######################################
> check process mythbackend with pidfile /var/run/mythbackend.pid
>    group mythtv
>    start program = "/etc/init.d/mythbackend start"
>    stop program  = "/etc/init.d/mythbackend stop"
>    if failed port 6544 proto http then restart
>    if 5 restarts within 5 cycles then timeout
>    depends on mysql
>
> ###############  MySQL  ###########################################
> check process mysql with pidfile /var/run/mysqld/mysqld.pid
>    group database
>    start program = "/etc/init.d/mysqld start"
>    stop program = "/etc/init.d/mysqld stop"
>    if failed port 3306 protocol mysql then restart
>    if 5 restarts within 5 cycles then timeout
>
> ###################  Web   ####################################
> check process apache with pidfile /var/run/httpd.pid
>    every 5 cycles
>    group www
>    start program = "/etc/init.d/httpd start"
>    stop  program = "/etc/init.d/httpd stop"
>    if failed port 80 protocol HTTP request /monit/token then restart
>    if 5 restarts within 5 cycles then timeout
>
>   
As a follow up on this:

I had to change the start command to use condrestart:
/etc/init.d/mythbackend condrestart.

This is because the 'start' command checks for the existence of a 'lock' 
file in  /var/lock/subsys. 

In a normal shutdown, this file is removed.  However, when it crashes, 
it is left behind, and thus prevents 'start' from working.  This is also 
the case when manually trying to start the service.  That file must not 
exist (as I discovered sleepily at 11:00 last night:) )

Brian


More information about the mythtv-users mailing list