LinHES Forums
http://forum.linhes.org/

How to restart mythfrontend after a crash using your remote!
http://forum.linhes.org/viewtopic.php?f=3&t=2774
Page 2 of 3

Author:  Spektr [ Thu Oct 28, 2004 2:21 pm ]
Post subject: 

True, the reason should be investigated. However, if a non-technical person simply wants to watch, they shouldn't have to restart the machine to get the frontend (or backend) back. The backend, if it crashes, is usually more serious, in my experience. The front end sometimes crashes even on otherwise stable systems, so IMO it would be useful. Just my $0.02 :)

cesman wrote:
If the frontend or backend dies, it is dying for a reason. While your's is a good idea, it is best to investigate why the death has occured first before restarting the process.

Author:  aelinuxguy [ Thu Oct 28, 2004 5:13 pm ]
Post subject: 

Quote:
However, if a non-technical person simply wants to watch, they shouldn't have to restart the machine to get the frontend (or backend) back.


Or, in the case of my wife, that non-technical person gets furious and cycles the power on the PVR without properly shutting it down. Before you know it, your /cache partition is corrupted and you cannot figure out wht it keeps getting worse :wink:

Author:  Spektr [ Fri Oct 29, 2004 10:32 am ]
Post subject: 

EXACTLY! I set up a MythTV box for my parents and they kept powercycling it (FE crashed sometimes with 0.16....more stable now). That is why I went through the trouble of coming up with a solution :)

aelinuxguy wrote:
Quote:
However, if a non-technical person simply wants to watch, they shouldn't have to restart the machine to get the frontend (or backend) back.


Or, in the case of my wife, that non-technical person gets furious and cycles the power on the PVR without properly shutting it down. Before you know it, your /cache partition is corrupted and you cannot figure out wht it keeps getting worse :wink:

Author:  jimmyfergus [ Sat Jan 29, 2005 3:07 pm ]
Post subject: 

Good tips here thank you - here's my restartmyth.sh script variation.

This script will restart the front end on a single press, and reboot on a double press.
Code:
#!/bin/bash
# Script for powerbutton press on Mythtv.  Double click (within
# timeout) will reboot, single press will restart frontend

DOUBLE_PRESS_TIMEOUT=2

SCRIPTNAME=`basename $0`
OLDEST_SCRIPT_PID=`pgrep -o $SCRIPTNAME`

OUR_PID=$$

# check if we are the oldest instance of this script
if [[ "$OLDEST_SCRIPT_PID" == "$OUR_PID" ]]
then
    killall mythfrontend
    sleep $DOUBLE_PRESS_TIMEOUT
    mythfrontend &
else
    # this is a doublepress
    kill $OLDEST_SCRIPT_PID
    sudo reboot
fi

While I haven't had frontend lockups, I do get PVR350 TV-out display lockups, that I haven't managed to find a fix or workaround for, so they necessitate a reboot.

Author:  tjimenez87 [ Fri Feb 25, 2005 2:30 am ]
Post subject: 

Anyone know how to autostart irexec in the new fluxbox window manager in R5? Should we change the apps file in .fluxbox? I tried creating a startup file in that dir, but that didnt work.

Author:  cesman [ Fri Feb 25, 2005 4:06 am ]
Post subject: 

Code:
more /home/mythtv/.fluxbox/apps

I'm sure you get the idea...

Author:  alusby [ Wed Aug 03, 2005 8:39 pm ]
Post subject: 

I added this to /home/mythtv/.fluxbox/apps

[startup] {irxevent &)
[startup] {irexec &)

....but it didn't work.

Anyone know if there's a problem with these lines or should I be looking elsewhere? :?:

Author:  tjc [ Wed Aug 03, 2005 8:42 pm ]
Post subject: 

Did you resart GDM afterwards so that fluxbox would pickup the changed setting?

Oh, and you botched the braces... ')' is not '}'

Author:  alusby [ Wed Aug 03, 2005 9:02 pm ]
Post subject: 

LOL. wow.

I can't believe I didn't notice that I had )'s instead of }'s. The worst part is that I pasted it and still didn't see it.

I fixed them and all works fine. No more having to vnc in!

Maybe I need to get my eyes checked :lol:

Thanks!!!

Author:  nigelpearson [ Thu Aug 04, 2005 2:13 am ]
Post subject: 

Instead of dedicating a key on my remote to do this, I just make sure another mythfrontend starts up if the first one dies:

Look for the script that normally starts up mythfrontend (I think it is /usr/local/bin/KnoppMyth-run) and change the line that looks like this:

CMD2='exec mythfrontend'

to

CMD2='mythfrontend;mythfrontend;mythfrontend;mythfrontend;mythfrontend'


This will let the frontend crash (and restart) 4 times before you have to reach for the keyboard to do Ctl-Alt-Backspace.

Author:  mattshaw [ Fri Sep 09, 2005 6:55 pm ]
Post subject: 

Hey Spektr, and all others who posted here, great little scripts, really helped.

Apart from Mythtvosd, which only creates pop-ups while watching livetv and recordings, does anyone have any idea how to make pop-ups appear throughout myth, ie. on the X-Window ?

The mods that Spektr mentioned to modify /home/.fvwm/.fvwm2rc do not not apply to R5A16, as the Window Manager is Fluxbox.


Thanx in advance

Matt Shaw
matt@shagshaw.com

Author:  cesman [ Fri Sep 09, 2005 7:08 pm ]
Post subject: 

~/.fluxbox/apps

Author:  mattshaw [ Sun Sep 11, 2005 11:43 am ]
Post subject:  Myth pop-ups

Thanks for the above, cesman, but I meant how would I modify the Xstartup to allow popup X-Dialogs to be displayed over the top of the myth menus ??

Regards

Matt Shaw
matt@shagshaw.com

Author:  mooselander [ Sat Oct 22, 2005 8:44 am ]
Post subject: 

nigelpearson wrote:
Instead of dedicating a key on my remote to do this, I just make sure another mythfrontend starts up if the first one dies:

Look for the script that normally starts up mythfrontend (I think it is /usr/local/bin/KnoppMyth-run) and change the line that looks like this:

CMD2='exec mythfrontend'

to

CMD2='mythfrontend;mythfrontend;mythfrontend;mythfrontend;mythfrontend'


This will let the frontend crash (and restart) 4 times before you have to reach for the keyboard to do Ctl-Alt-Backspace.


I'm using a modified workaround based on this idea. With the help of a co-worker (who's more adept at Linux than I am), I've placed a script called mythfrontend-wrapper.sh in /usr/local/bin

Code:
#!/bin/bash

# mythfrontend-wrapper.sh called by Knoppmyth-run
while [ 1 ]
 do
  mythfrontend
 done


I've edited /usr/local/bin/Knoppmyth-run to execute this wrapper script rather than mythfrontend itself:

CMD2='exec mythfrontend-wrapper.sh'

Mythfrontend gets launched by the script's do-while loop. When it crashes or exits for any reason, the loop is restarted and mythfrontend is launched again (indefinitely).

To exit mythfrontend and get to the X-server GUI, I'll kill the mythfrontend-wrapper.sh process remotely through SSH. This situation is very rare though, since I do most of my changes or updates through SSH or VNC. The console is strictly used for watching recordings or live tv.

I haven't pinned down the source of my frontend crashes yet, so this workaround has alleviated some of the heartburn that they were causing. My crash problem has something to do with a scheduled recording changing the channel while live tv is being watched. I haven't had time to research this problem in earnest, but the searches I've done so far have turned up empty.

Hope this helps somebody.

Author:  declanh [ Tue Dec 06, 2005 7:40 am ]
Post subject: 

mooselander wrote:
nigelpearson wrote:
Instead of dedicating a key on my remote to do this, I just make sure another mythfrontend starts up if the first one dies:

Look for the script that normally starts up mythfrontend (I think it is /usr/local/bin/KnoppMyth-run) and change the line that looks like this:

CMD2='exec mythfrontend'

to

CMD2='mythfrontend;mythfrontend;mythfrontend;mythfrontend;mythfrontend'


This will let the frontend crash (and restart) 4 times before you have to reach for the keyboard to do Ctl-Alt-Backspace.


I'm using a modified workaround based on this idea. With the help of a co-worker (who's more adept at Linux than I am), I've placed a script called mythfrontend-wrapper.sh in /usr/local/bin

Code:
#!/bin/bash

# mythfrontend-wrapper.sh called by Knoppmyth-run
while [ 1 ]
 do
  mythfrontend
 done


I've edited /usr/local/bin/Knoppmyth-run to execute this wrapper script rather than mythfrontend itself:

CMD2='exec mythfrontend-wrapper.sh'

Mythfrontend gets launched by the script's do-while loop. When it crashes or exits for any reason, the loop is restarted and mythfrontend is launched again (indefinitely).

To exit mythfrontend and get to the X-server GUI, I'll kill the mythfrontend-wrapper.sh process remotely through SSH. This situation is very rare though, since I do most of my changes or updates through SSH or VNC. The console is strictly used for watching recordings or live tv.

I haven't pinned down the source of my frontend crashes yet, so this workaround has alleviated some of the heartburn that they were causing. My crash problem has something to do with a scheduled recording changing the channel while live tv is being watched. I haven't had time to research this problem in earnest, but the searches I've done so far have turned up empty.

Hope this helps somebody.


I cant pin down my Frontend crashes either - so i thought i would try this as a stopgap.
Set it up and tested it. Exiting the Frontend manually caused the frontend to resart (great!)
however after a crash it did not restart - I suspect the frontend is either zombied or hung in this case

anyone know how i can detect this (via ps -elf for eg) - if required i suppose i could write a nasty script to poll for the hung process and kill it.

Page 2 of 3 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/