<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
If someone needs it here is the part I've customized in my monitrc file
under /etc/monit/<br>
<br>
<pre>check process mythbackend with pidfile /var/run/mythtv/mythbackend.pid</pre>
<pre>&nbsp;&nbsp;&nbsp; start program = "/etc/init.d/mythtv-backend restart"</pre>
<pre>&nbsp;&nbsp;&nbsp; stop program&nbsp; = "/etc/init.d/mythtv-backend stop"</pre>
<pre>&nbsp;&nbsp;&nbsp; if 5 restarts within 5 cycles then timeout</pre>
<br>
So far it works like a charm.<br>
<br>
I've also customized the mail alert, of course.<br>
<br>
Best regards,<br>
&nbsp;&nbsp;&nbsp; Paolo<br>
<br>
<br>
David Greaves ha scritto:
<blockquote cite="mid:473C29D0.5040301@dgreaves.com" type="cite">
  <pre wrap="">John wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">I'm trying to use monit to monitor the backend but I
can't get it to work properly. I followed the
instructions on the MythTv wiki except I start the
front and back as a user so I added this to the
monitrc file.
    </pre>
  </blockquote>
  <pre wrap=""><!---->You say you added this?
Are you using /etc/init.d/mythtv-backend because that usually specifies the user
that myth runs as.

Post your monitrc please.

  </pre>
  <blockquote type="cite">
    <pre wrap="">When monit trys to start the backend, I
get Unable to read config file mysql.txt and Could not
create //.mythtv. I figured it was a path problem so I
did an echo $PATH and it said home/mythtv/bin so I
added this to the /etc/rc.d/init.d/mythbackend script
but it didn't help.
    </pre>
  </blockquote>
  <pre wrap=""><!---->I would restore that to the original state.

I think your problem is that monit should run the starup script as root so the
startup script can change to the myth user.

You made monit run the script as a user but without proper initialisation (ie
setting paths etc).

Before you changed it did /etc/rc.d/init.d/mythbackend work?

David


_______________________________________________
mythtv-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a>
<a class="moz-txt-link-freetext" href="http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users">http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users</a>
  </pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<table
 style="background: rgb(255, 255, 255) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal;"
 border="0" cellpadding="0" cellspacing="0" width="600">
  <tbody>
    <tr bgcolor="#003399">
      <td
 style="border-top: 1px solid rgb(0, 51, 153); border-left: 1px solid rgb(0, 51, 153); padding-left: 15px; color: rgb(255, 255, 255);"
 width="330"> <b style="font-size: 14px;">Ing. Paolo Asioli</b><br>
      </td>
      <td style="border: 1px solid rgb(0, 51, 153);" align="right"
 width="385"><img src="cid:part1.03090200.03010704@libero.it" alt=""
 height="42" width="385"></td>
    </tr>
    <tr>
      <td colspan="2"
 style="border-style: solid; border-color: rgb(0, 51, 153); border-width: 0pt 1px; padding: 10px 0pt 10px 30px;">
      <table
 style="font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal;"
 border="0" cellpadding="0" cellspacing="0" width="100%">
        <tbody>
          <tr style="line-height: 15px;" valign="top">
            <td width="30%"> <b style="color: rgb(153, 153, 153);">Casa:</b>+39
011 3851662<br>
            <b style="color: rgb(153, 153, 153);">Mobile:</b>+39 335
8430361<br>
            </td>
            <td style="padding-left: 15px;" width="40%"> <b
 style="color: rgb(153, 153, 153);">Email:</b> <a target="nw"
 href="mailto:paolo.asioli@libero.it"
 style="text-decoration: none; color: rgb(0, 0, 0);">paolo.asioli@libero.it</a><br>
            <img src="cid:part2.01020605.01070205@libero.it" alt=""
 align="middle" height="14" width="14"> <b><a target="nw"
 href="http://www.linkedin.com/in/paoloasioli">http://www.linkedin.com/in/paoloasioli</a></b><br>
            </td>
            <td style="padding: 0pt 15px;" width="30%"> <br>
            </td>
          </tr>
        </tbody>
      </table>
      </td>
    </tr>
    <tr
 style="font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;">
      <td
 style="border-top: 1px solid rgb(0, 51, 153); padding-top: 2px;"><a
 target="nw" href="http://www.linkedin.com/e/wwk/4804055/">Verifica le
nostre conoscenze in comune</a></td>
      <td
 style="border-top: 1px solid rgb(0, 51, 153); padding-top: 2px;"
 align="right"><a target="nw"
 href="http://www.linkedin.com/e/sig/4804055/">Vuoi una firma come
questa ?</a> </td>
    </tr>
  </tbody>
</table>
</div>
</body>
</html>