[mythtv-users] CTRL-ALT-BACKSPACE -> multiple instances of mythfrontend

Allen Edwards allen.p.edwards at gmail.com
Mon Mar 11 02:55:51 UTC 2019


I agree. Will try your new script tomorrow. Races are nasty and the best
way to deal with them is to "fix" the race.  That is a pun. Sorry about the
top post but......

Allen

On Sun, Mar 10, 2019, 7:31 PM Stephen Worthington <stephen_agent at jsw.gen.nz>
wrote:

> On Sun, 10 Mar 2019 14:59:19 -0700, you wrote:
>
> >I added a 10 second delay and the problem is gone, no duplicate instances
> >of myth. Maybe 3 seconds would work but definitely a race condition.
> Other
> >than the delay, the code is the same as original.
> >
> >In fairness to the code, my test is not real life.  Typically if I were to
> >do a CTRL-ALT-BS it would be because myth was frozen or missing. I don't
> >know that I ever did a CTRL-ALT-BS just as a test with Myth running. The
> >timing might be different and the service might be killed faster if it is
> >actually frozen. Or maybe I am wrong and this really is an issue.  Either
> >way, it should not keep piling on instances of mythfrontend.  But at least
> >I think we know what is going on now.
> >
> >Allen
>
> Using a delay to fix a race condition is usually a bad idea -
> something happens which changes the timing, such as a bit of swapping
> going on, and then the problem is back again.
>
> Unfortunately, mythfrontend does die quite often for me.  The usual
> cause is playing a downloaded video file.  I have quite a few that it
> can not handle, and either it dies, or locks up and I have to kill it.
> Some of the deaths leave behind "assert failed" messages.  But if you
> do not normally play such files, then mythfrontend can be very
> reliable and not need the wrapper script.
>
> It looks like the wrapper script needs to be able to detect that the
> script itself is still running and to exit if it can see another copy
> of itself.  This should work to do that:
>
> pid=$(ps -ef | grep '/bin/sh /usr/bin/mythfrontend --service' | grep
> -v grep | awk '{print $2}')
> if [ ${#pid} -ne 0 ]; then
>     exit 0
> fi
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20190310/455e3269/attachment.html>


More information about the mythtv-users mailing list