[mythtv-users] Backend constantly restarting

Larry Finger Larry.Finger at lwfinger.net
Tue Dec 1 00:38:56 UTC 2009

On 11/30/2009 06:04 PM, Michael T. Dean wrote:
> On 11/30/2009 06:36 PM, Matthias Thyroff wrote:
>> On 11/28/2009 12:21 AM, Michael T. Dean wrote:
>>> On 11/27/2009 02:13 PM, Michael Harnden wrote:
>>>> On Tuesday 24 November 2009 12:56:03 pm Michael T. Dean wrote: 
>>>>> How was monit set to monitor the backend's status?  I need to know so
>>>>> I can try to figure out why monit is killing Myth.
>>>> # Monit control file
>>>> #
>>>> # Comments begin with a '#' and extend through the end of the line.
>>>> # Blank lines between program entries are ignored. Keywords are case
>>>> # insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'
>>>> #
>>>> set daemon  30
>>>> set logfile /var/log/monit.log
>>>> set mail-format
>>>>  { from: mike at XXXX.site}
>>>> set alert mike at XXXX.site  # Send alert to system admin on any event
>>>> set httpd port 2812 and
>>>>     allow XXXX.site
>>>>     allow
>>>>     allow
>>>>     allow admin:monit     # user 'admin' with password 'monit'
>>>> check process mythbackend with pidfile /var/run/mythtv/mythbackend.pid
>>>>  #group mythtv
>>>>  start program = "/etc/init.d/mythtv-backend restart"
>>>>  stop program  = "/etc/init.d/mythtv-backend stop"
>>>> # if failed port 6544 proto http then restart
>>> Does this mean the mythbackend check is commented/doing nothing?
>>>>  depends on mysql
>>>> check process mysql with pidfile /var/run/mysqld/mysqld.pid
>>>>  #group mythtv
>>>>  start program = "/etc/init.d/mysql start"
>>>>  stop program = "/etc/init.d/mysql stop"
>>>>  if failed port 3306 then restart
>>> If so, would that mean that monit is restarting mysql over and over? 
>>> (Ripping the MySQL server out from under Myth would cause problems.)
>> I also just found out that it is monit who is restarting my backend every
>> 2 minutes - that was a long way of way too much suffering.
>> It seems that myth backend 0.22 does not write the
>> /var/run/myththv/mythbackend.pid file anymore - and monit used that file
>> for checking for the process. Fails, of course and restarts the service.
>> From short investigation it seems there is no pid file at all anymore.
>> This is where I stop today.
>> Have a good day, thanks for the greatest tv software ever (well don't
>> know
>> any other, don't need to, either, because myth does what I need and much
>> more)
> Sounds like a problem with the *buntu mythbackend start scripts--perhaps
> introduced in the switch to upstart.  I don't know whether it means that
> the monit config needs changing or whether the upstart script needs
> changing.

On openSUSE, the standard start script for mythbackend needed to be
modified. Initially it had the the -p switch as an argument to
startproc, but there was no pid file created. By moving it to _AFTER_
the starting of mythbackend ($MYTHBACKEND_BIN), then the pid file was
created. The resulting command is:

HOME=${MYTHBACKEND_HOME} /sbin/startproc \
     $MYTHBACKEND_BIN --daemon -p /var/run/mythbackend.pid \
     --logfile /var/log/mythtv/mythbackend.log \


More information about the mythtv-users mailing list