[mythtv-users] Script to restart backend after crash?
Marc
drayson at net1plus.com
Sun Jan 20 13:36:52 UTC 2008
> -----Original Message-----
> From: mythtv-users-bounces at mythtv.org [mailto:mythtv-users-
> bounces at mythtv.org] On Behalf Of Piers Kittel
> Sent: Sunday, January 20, 2008 6:31 AM
> To: Discussion about mythtv
> Subject: Re: [mythtv-users] Script to restart backend after crash?
>
> All excellent suggestions, shame none of those works due to my
> original problem. So looks like I'll have to fix that first :/
>
> Thanks to all for your time though!
>
> Regards - Piers
>
> On 20 Jan 2008, at 06:08, David Whyte wrote:
>
> > On Jan 19, 2008 1:25 AM, Piers Kittel <mailing at biased.org> wrote:
> >
> >>
> >> So I need some sort of script to monitor the backend and restart it
> >> automatically when it stops working for some reason. Does anyone
> >> have
> >> some? The package I use is from debian-multimedia.org, currently
> >> version 0.20.2-0.2. It does come with its own startup script but
> >> doesn't work for some reason:
> >>
> >
> > My script is attached. It runs every minute from cron. I think I
> > copied it off the mythTV wiki or something.
> >
> > #!/bin/bash
> >
> > pidno=$( ps ax | grep /usr/bin/mythbackend | grep -v grep | grep -v
> > mythbackend_monitor)
> > # Checks for pid in "ps" listing, field #1.
> > # Then makes sure it is the actual process, not the process invoked
> by
> > this script.
> > # The last "grep $1" filters out this possibility.
> > if [ -z "$pidno" ] # If, after all the filtering, the result is a
> > zero-length string,
> > then # no running process corresponds to the pid
> given.
> > echo "No such process running."
> > mail david at thewhytehouse.org -s "MythTV Restart" <
> > /var/log/mythtv/mythbackend.log
> > /etc/init.d/mythtv-backend restart
> > fi
> >
> > Cheers,
> > Whytey
Piers,
Why does your startup script not work? Let's try and fix that first.
Provide us with the logs from mythbackend.log for when you start myth from
the script. That would help identify why it is not working.
Marc
More information about the mythtv-users
mailing list