Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Users

mythbackend pid

 

 

First page Previous page 1 2 Next page Last page  View All MythTV users RSS feed   Index | Next | Previous | View Threaded


william_munson at bellsouth

Jul 5, 2007, 4:18 AM

Post #26 of 36 (4000 views)
Permalink
Re: mythbackend pid [In reply to]

A JM wrote:
> Well we seem to back to the original question because when I launch
> mythbackend there is no PID file in /var/run so I "assume" that monit
> can''t monitor something that doesn't exist, hence my problem...
>
> Would using just the response from port 6544 work?
>
> Will the devs be adding back the PID file for mythbackend?
>
>
>
The problem you need to track down is why your backend is not creating a
pid file. You mentioned that you are running SVN. You should be able to
start the backend with the provided init script for your distro without
any additional command line options and it will create a pid file in
/var/run. Are you sure that the user you run the backend under has write
access to /var/run? I run mine under root for simplicity sake.

The devs have not disabled pid files so the problem is with your setup.


_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


vbtalent at gmail

Jul 5, 2007, 4:21 AM

Post #27 of 36 (3982 views)
Permalink
Re: mythbackend pid [In reply to]

Gotcha, I'm checking into permissions at the moment.

Thanks,
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


vbtalent at gmail

Jul 5, 2007, 4:25 AM

Post #28 of 36 (3989 views)
Permalink
Re: mythbackend pid [In reply to]

I gave my user permissions to create files in /var/run so that isn't
the issue at the moment.

Will running mythbackend from the CL automatically create the PID file
or does it need to be explicitly passed from the CL?

AJM,
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mythtv at hotblack

Jul 5, 2007, 4:29 AM

Post #29 of 36 (3996 views)
Permalink
Re: mythbackend pid [In reply to]

>Just an FYI, I'm running Ubuntu SVN 13754.
>
>Just looking in my current monitrc file and this is what I have.
>
> group mythtv
> start program = "/usr/local/bin/mythbackend --pidfile
>/var/run/mythtv/mythbackend.pid restart"
> stop program = "/usr/local/bin/mythbackend stop"
> if failed port 6544 then restart
> depends on Mysql
> #depends on Lirc
>


I don't think that is going to work. If mythbackend has locked up,
or isn't running at all, then doing "/usr/local/bin/mythbackend stop"
isn't much help.

I've never used Ubuntu, but I think the way to start/stop the backend is
/etc/init.d/mythtv-backend start|stop

(sample init.d script here http://parker1.co.uk/myth/mythtv-backend
in case yours is missing)


So then the monitrc should have this:
####################
check process mythbackend with pidfile /var/run/mythtv/mythbackend.pid
group mythtv
start program = "/etc/init.d/mythtv-backend start"
stop program = "/etc/init.d/mythtv-backend stop"
if failed port 6544 proto http then restart
mode manual
depends on mysql
####################

- Wade
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mythtv at hotblack

Jul 5, 2007, 4:31 AM

Post #30 of 36 (3987 views)
Permalink
Re: mythbackend pid [In reply to]

>Well we seem to back to the original question because when I launch
>mythbackend there is no PID file in /var/run so I "assume" that monit
>can''t monitor something that doesn't exist, hence my problem...
>
>Would using just the response from port 6544 work?
>
>Will the devs be adding back the PID file for mythbackend?
>
>Thanks,

How are you launching mythbackend? On my machine it's handled
ultimately via /etc/rc.d/init.d/mythbackend
and it has the option sin there on creating the pid.

However with monit, the pid is a nice to have, and the network status
port should be enough to get you going.

- Wade
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


william_munson at bellsouth

Jul 5, 2007, 4:48 AM

Post #31 of 36 (3989 views)
Permalink
Re: mythbackend pid [In reply to]

A JM wrote:
> I gave my user permissions to create files in /var/run so that isn't
> the issue at the moment.
>
> Will running mythbackend from the CL automatically create the PID file
> or does it need to be explicitly passed from the CL?
>
>

Running from the CL does not result in a pid. Let me check the required
option....


_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


william_munson at bellsouth

Jul 5, 2007, 4:50 AM

Post #32 of 36 (3994 views)
Permalink
Re: mythbackend pid [In reply to]

A JM wrote:
> I gave my user permissions to create files in /var/run so that isn't
> the issue at the moment.
>
> Will running mythbackend from the CL automatically create the PID file
> or does it need to be explicitly passed from the CL?
>
>

I successfully created a pid with -p /var/run/mythbackend.pid


_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


vbtalent at gmail

Jul 5, 2007, 5:42 AM

Post #33 of 36 (3987 views)
Permalink
Re: mythbackend pid [In reply to]

I've just been running from the CL using mythbackend... I thought the
running of the process itself should create a PID? strange, is that
not normal...

So, if I run from the CL "mythbackend -p /var/run/mythbackend.pid"
then I should be good to go?? will an abandoned PID file then be
removed from /var/run after a backend crash?

Thanks,
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


david at thegeorges

Jul 5, 2007, 5:52 AM

Post #34 of 36 (3974 views)
Permalink
Re: mythbackend pid [In reply to]

On 07/05/2007 08:42 AM, A JM wrote:
> I've just been running from the CL using mythbackend... I thought the
> running of the process itself should create a PID? strange, is that
> not normal...
>

No, it isn't strange. It all depends on how the developer wrote the
program. Daemons do not need to write a pidfile. The OS doesn't need
them. They are mostly a convenience for init script writers.

> So, if I run from the CL "mythbackend -p /var/run/mythbackend.pid"
> then I should be good to go?? will an abandoned PID file then be
> removed from /var/run after a backend crash?
>

That isn't how it works. Nothing will remove the pid file on crash.
What you do is read the pid file if it exists and then check to see if
the process is running. Probably the easiest way to see if the process
is still running in linux is to see if the PID exists as a directory in
/proc.

--
David

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


vbtalent at gmail

Jul 5, 2007, 6:01 AM

Post #35 of 36 (3993 views)
Permalink
Re: mythbackend pid [In reply to]

Aaah, monit reads the PID file to determine if mythbackend has
crashed. The PID file is then just logged with running information on
the process.

Should the monitrc script look like the following?

group mythtv
start program = "/usr/local/bin/mythbackend -p
/var/run/mythbackend.pid /var/run/mythtv/mythbackend.pid restart"
stop program = "/usr/local/bin/mythbackend stop"
if failed port 6544 then restart
depends on Mysql

Thanks.

AJM,
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mythtv at hotblack

Jul 5, 2007, 3:44 PM

Post #36 of 36 (3971 views)
Permalink
Re: mythbackend pid [In reply to]

>Aaah, monit reads the PID file to determine if mythbackend has
>crashed. The PID file is then just logged with running information on
>the process.
>
>Should the monitrc script look like the following?
>
>group mythtv
> start program = "/usr/local/bin/mythbackend -p
>/var/run/mythbackend.pid /var/run/mythtv/mythbackend.pid restart"
> stop program = "/usr/local/bin/mythbackend stop"
> if failed port 6544 then restart
> depends on Mysql
>
>Thanks.
>
>AJM,

No.

It should look exactly like this:
####################
check process mythbackend with pidfile /var/run/mythtv/mythbackend.pid
group mythtv
start program = "/etc/init.d/mythtv-backend start"
stop program = "/etc/init.d/mythtv-backend stop"
if failed port 6544 proto http then restart
mode manual
depends on mysql
####################

- Wade
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

First page Previous page 1 2 Next page Last page  View All MythTV users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.