View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 37 posts ] 
Go to page Previous  1, 2, 3

Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject:
PostPosted: Tue Dec 06, 2005 11:47 am 
Offline
Joined: Mon Jun 27, 2005 4:42 pm
Posts: 321
Location: Minneapolis, Minnesota, USA
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.

In an ideal world, figuring out whats going on would mean it could get fixed, but many of us have given up on that in practice. I've been runnnig Myth for about three years now: two different machines, one built from source (three different versions), one running Knoppmyth (two different revs). All have died fairly regularly (once or twice a week). At first I spent hours and hours trying to figure out what was wrong. At one point on one of the systems I even identified which line of C++ in Myth was causing the segfault. I posted detailed analysis of the problem to the MythTV mailing list. It just didn't help. After beating my head against the wall, I just gave up and decied to live with a crash rate of once or twice a week. I had hoped that stability would improve over time, but it doesn't really seem to. Now I just ssh in and "shutdown -fr now" when Myth stops working. If I can't ssh in, I hit the reset button.

I suspect most of the crashes on my boxes (apart from the segfault issue mentioned above) are due to the ivtv driver which is still under very active development. I choose to run a rather bleeding-edge version of ivtv so I can have Xv support, and I have to live with the crashes.

_________________
Grant


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 07, 2005 12:27 pm 
Offline
Joined: Sat Oct 22, 2005 8:19 am
Posts: 23
declanh wrote:
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.


You could come up with something that greps for mythfrontend, but I'm not sure how you would identify a hung mythfrontend from a healthy one.

Code:
sh-3.00$ ps waux | grep mythfrontend
mythtv    5131  0.0  0.2   2936  1324 ?        Ss   Dec06   0:00 /bin/bash /usr/local/bin/mythfrontend-wrapper.sh
mythtv    5132  1.3  9.0 149420 46528 ?        Sl   Dec06  12:07 mythfrontend
mythtv    6007  0.0  0.0   1644   500 ttyp0    S+   12:13   0:00 grep mythfrontend


When I implemented this workaround, my frontend was crashing or exiting cleanly back to the X server console.

If your frontend is crashing in such a way that it's hanging and not exiting, then this wrapper script won't do much good. The script won't respawn a new mythfrontend session since it's not seeing the previously spawned process exit.


Top
 Profile  
 
PostPosted: Tue Mar 28, 2006 6:26 pm 
Offline
Joined: Tue Mar 14, 2006 3:39 pm
Posts: 8
I tried lirc-reconfig.sh as root. Selected the type as hauppage and the remote type as silver. It gave the following msgs

Stopping lirc daemon: lircmd lircd.
Starting lirc daemon: lircdDriver `default' not supported.
Supported drivers:
null


Hello,

I tried the following
apt-get update && apt-get install lirc-x xdialog
and noted that /etc/lircd.conf was symlinked to /etc/lirc/lircd.conf

But without continuing the rest of the steps, shutdown the machine. Now when i start the machine my remote has totally stopped working. I have pvr 350. can anybody suggest what steps should i take to get it back working ?
Initially during the initial knoppmyth setup, it has asked for the type of remote and i had specified 350, and it had worked right out of the box.

I tried apt-get remove lirc-x and apt-get remove xdialog and copied
/usr/local/share/knoppmyth/remotes/hauppauge/etc/lircd.conf to /etc/lirc/lircd.conf, but even that did not work.

thanks

Spektr wrote:
NOTE: this can be used to restart whatever you want, but here I use to to restart mythfrontend ;)

Well, I'm sure all of you at one point in time have had mythfrontend crash on you. It's easy to restart, but if your loved one(s) use your mythtv box, they may not be able to! Well, here is an easy way to be able to use your remote to easily restart mythfrontend! The following will cause a small box to pop up onscreen allowing you so select whether or not you'd like to restart mythfrontend.

Note: I have a Hauppauge PVR-250 remote, if you don't you may have to adjust the buttons accordingly

Without further adue...

We will be using irexec and irxevent to do this, as well as xdialog to make the popup, so first:

Code:
apt-get update && apt-get install lirc-x xdialog


Note, this will move your /etc/lircd.conf to /etc/lirc/lircd.conf, so you will have to copy it back.

Next we have to configure irxevent and irexec to start when X is started, so we add the following lines to /home/.fvwm/.fvwm2rc (this is at the bottom of the file)

Code:
#Remove comment to start irxevents
exec irxevent &
exec irexec &


Also, we want to change the focus model in .fvwmrc to make the popup box come to the front, and focus, so make these changes to the .fvwm2rc file as well:

Comment out
Code:
#ColormapFocus FollowsMouse


and add
Code:
Style * GrabFocus, GrabFocusTransient


Then comment out
Code:
#Style *           FocusFollowsMouse


And save.

With that done, we will now create a simple script to make the popup:

With your favourite editor, create a file (I called mine restartmyth.sh) with the following in it:

Code:
#!/bin/sh

 Xdialog --title "Restart MythTV" --yesno "Would you like to restart
 MythTV?" 0 0

 if [ $? -eq 0 ]
 then
     killall mythfrontend
     mythfrontend &
fi


Then copy it to somewhere in your path...I chose /usr/bin.

Next, give proper permissions to mythtv user, so (as root):

Code:
chown root:mythtv /path/to/yourfilename.sh
chmod 770 /path/to/yourfilename.sh


Next, we want to bind this script to a key on the remote, so edit your /home/mythtv/.lircrc and add these lines:

Code:
begin
   prog = irexec
   button = Go
   config = restartmyth.sh &
end

begin
    prog = irxevent
    button = Ok
    repeat = 0
    config = Key KP_Enter CurrentWindow
end

begin
    prog = irxevent
    button = Vol+
    repeat = 3
    config = Key Right CurrentWindow
end

begin
    prog = irxevent
    button = Vol-
    repeat = 3
    config = Key Left CurrentWindow
end



Note, you can configure the buttons to be whatever you want. Note that I set "GO" to launch this popup dialog, and I set left and right and OK buttons so I can go back and forth and select. Also note that if you bind the left and right keys using irxevent, you will want have to comment out the other left/right keybindings in your .lircrc or else you will be passing the commands twice ;)

Now, save, and reboot...that's it!

Enjoy.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 28, 2006 8:16 pm 
Offline
Joined: Tue Mar 14, 2006 3:39 pm
Posts: 8
newbies should be careful when using this tip. chances are that after this the remote will not function.

during the apt-get update step, it will install the new version of lirc
(0.7.2-2).. seems like for some reason, the remote will stop working after this.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=352767

i downgraded lirc to 0.7.1pre2-2 and ran lirc-reconfig.sh again, and the remote is working


Top
 Profile  
 
PostPosted: Thu Mar 30, 2006 2:02 am 
Offline
Joined: Sun Jul 18, 2004 5:33 pm
Posts: 3
sandstone wrote:
I tried lirc-reconfig.sh as root. Selected the type as hauppage and the remote type as silver. It gave the following msgs

Stopping lirc daemon: lircmd lircd.
Starting lirc daemon: lircdDriver `default' not supported.
Supported drivers:
null


I foolishly followed this tip on my recently installed R5B7 install and mucked up my lirc as in the above quote.
In R5B7 you do not need to apt-get install lirc-x. Only apt-get install xdialog. Nor do you need to do any of the fvwm2 stuff, as R5 uses fluxbox.

If like me you went into this blind (without reading all the posts), you can recover your setup by following this post:
http://mysettopbox.tv/phpBB2/viewtopic. ... 4473#54473

Good luck! :)
Dilmah


Top
 Profile  
 
PostPosted: Thu Mar 30, 2006 2:03 am 
Offline
Joined: Sun Jul 18, 2004 5:33 pm
Posts: 3
sandstone wrote:
I tried lirc-reconfig.sh as root. Selected the type as hauppage and the remote type as silver. It gave the following msgs

Stopping lirc daemon: lircmd lircd.
Starting lirc daemon: lircdDriver `default' not supported.
Supported drivers:
null


I foolishly followed this tip on my recently installed R5B7 install and mucked up my lirc as in the above quote.
In R5B7 you do not need to apt-get install lirc-x. Only apt-get install xdialog. Nor do you need to do any of the fvwm2 stuff, as R5 uses fluxbox.

If like me you went into this blind (without reading all the posts), you can recover your setup by following this post:
http://mysettopbox.tv/phpBB2/viewtopic. ... 4473#54473

Good luck! :)
Dilmah


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 18, 2006 12:27 pm 
Offline
Joined: Sat Jul 09, 2005 2:04 pm
Posts: 32
I adapted this to make my power button kill gdm with 1 press and with 2 to restart it.

You need to start up irexec as root, so I put the following line into /etc/gdm/PreSession/Default

Code:
irexec &


This is my script that will do the dirty work, I call it remote.sh
Code:
#!/bin/bash

FirstClickFile="/home/mythtv/.FirstClick"
maxClickTime=2

FirstClick() {
 date > $FirstClickFile
 sudo /etc/init.d/gdm stop
 # echo DEBUG: FirstClick!
 exit
}

SecondClick() {
 # If the time between the first and the second click was less than $maxClickTime, restart mythfrontend
 timeSinceLastClick=$(expr $(date +"%G%m%d%H%M%S") - $(date -f /home/mythtv/.FirstClick +"%G%m%d%H%M%S"))

 if [ "$timeSinceLastClick" -lt "$maxClickTime" ]; then
  # echo DEBUG: SecondClick!
  # sudo /etc/init.d/gdm stop
  gdm &
 else
  FirstClick
 fi

 rm -f $FirstClickFile
 exit
}

[ -f "$FirstClickFile" ] || FirstClick
SecondClick


and also the edit to your /home/myth/.lircrc file
Code:
begin
   prog=irexec
   button=Power
   config=sudo /home/mythtv/remote.sh &
end


The sudo may not be necessary, but it seems to work with it. Make sure to change /home/mythtv/remote.sh to the path of your bash script.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 37 posts ] 
Go to page Previous  1, 2, 3



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu