[mythtvnz] OT: monit

Wade Maxfield mythtvnz at hotblack.co.nz
Tue Nov 27 01:11:50 GMT 2007


Nick Rout wrote:
> OK so I am lazy, but how did you set it up for mythbackend?
> I have the problem with it stopping sometimes too.

I'm using FC6/Mythdora so some of the file paths may be a little 
different. The basic config files I have are

/etc/monit/monit_delay
-----------------
#! /bin/sh
# this lets the machine startup and get settled
# before monit starts worrying that mythbackend isn't going

sleep 10
/usr/local/bin/monit monitor mythbackend
-----------------


/etc/monit (excerpt of the stuff I added/changed)
-----------------
set daemon 60
set logfile /var/log/monit.log
set mailserver my.mail.server
set alert me[at]my.mail.server

check process mythbackend with pidfile /var/run/mythbackend.pid
group mythtv
start program = "/sbin/service mythbackend start"
stop program = "/sbin/service mythbackend stop"
if failed port 6544 proto http then restart
mode manual
depends on mysql

check process mysql with pidfile /var/run/mysqld/mysqld.pid
group mythtv
start program = "/etc/init.d/mysqld start"
stop program = "/etc/init.d/mysqld stop"
if failed port 3306 then restart
mode manual
-----------------


To stop mythbackend while you want to do other things, just run:
monit stop mythbackend

and

monit start mythbackend

to get it going again. That will run the respective stop and start 
commands as per your /etc/monit file.

There was a bit of a discussion about it a while ago on the main myth list.

http://www.gossamer-threads.com/lists/mythtv/users/277571#277571
http://www.gossamer-threads.com/lists/mythtv/users/120192

  - Wade



More information about the mythtvnz mailing list