Restart MythTV frontend via Remote

Recent comments

Who's new

  • rhpot1991

Restart MythTV frontend via Remote

Submitted by rhpot1991 on Mon, 01/11/2010 - 23:55

This one should help out any non-technical MythTV user. The most common issue I run into is when my wife goes to control the frontend and it has lost sync with the backend (most of the time because I was working on something and forgot to check on things when I was done). Simply restarting the frontend fixes these issues, but she doesn't know how to ssh in and handle this task, so lets make a button (or series if you want to be safe) on the remote do it for her.

Create a file in /usr/local/bin, call it whatever you want, I called mine restart-myth. Include the following in that file:

# /bin/bash
killall mythfrontend.real
DISPLAY=:0 /usr/bin/mythfrontend --service &

Then
sudo chmod +x <file from above>

Now in your ~/.lirc/mythtv file, we are going to add a button to handle our restarts. Start by copying one of the other button blocks, and modifying it to fit your needs. Here are my end results:

begin
remote = AntecFusionMCE.conf
prog = irexec
button = power
button = CLEAR
repeat = 0
config = restart-myth
end

Of importance here, I used 2 buttons because I want to avoid mistakes, so the user will need to hit power followed by clear. Most of your other blocks will say mythtv in the prog, we need irexec here to execute the script we made earlier. Lastly the script you created earlier is referenced in the config.

When everything is done you need to restart a few things, save anything you have opened and don't want to lose. For 9.10 run the following:

sudo /etc/init.d/lirc restart
sudo service gdm restart

Anything before 9.10 run this instead:

sudo /etc/init.d/lirc restart
sudo /etc/init.d/gdm restart

Plans are to introduce something close to this functionality into the Mythbuntu-Control-Centre for the Lucid release. Feel free to leave some feedback we are interested in what buttons people like for this option and ways they would want to handle avoiding accidental restarts.

Anonymous (not verified)

Tue, 01/12/2010 - 07:43

Hello,

I've setup a variation of this tutorial.

One thing I've noticed is that irexec need to be running somehow.

I've placed it in the startup programs of the session running mythfrontend.

I'm running Mythbuntu 9.10, upgraded throught the years from 7.04.

Nico

Anonymous (not verified)

Tue, 01/12/2010 - 15:20

It would be nice to have this setup by default by mythbuntu.. maybe with options

Remote Power Button
- does nothing
- restart front end
- restart X
- restart machine
- Power Off machine

Anonymous (not verified)

Wed, 01/13/2010 - 02:13

I have a similar shortcut, but found that MythTV sometimes drops control to mplayer (MythVideo does this). So I also pkill mplayer, so she can restart the whole thing from any component of MythTV's suite.

Restart GDM seems a little excessive though ... isn't it?

Good point with the other apps, we will have to take that into consideration. IMO there isn't much that internal player can't handle anymore, but I am sure there are some exceptions.

You could just execute your restart script you made earlier instead of restarting GDM, you just need to make sure you kill your current running mythfrontend before it will pick up any .lirc changes.

Anonymous (not verified)

Sun, 03/25/2012 - 12:12

I tried 10000 different ways only thing that works is things like back etc... no commands work ... I tryed su mythtv -c with export DISPLAY=:0 I even just try mplayer sound.ogg and I get NOTHING some times is just hangs all input from remote so I know its DOING SOMETHING but .... I also tried putting & at the end etc... I just @#$^ing hate linux some times .. the myth WIKI says -L is option for LIRC and its @#%ing not ... im done ... if frontend crashes then well im !@#%ed and have to grab the other remote ... so @#$%ing STUPID ** RANT RANT RANT RANT RANT RANT **

my notes:
https://docs.google.com/Doc?docid=0Aef2nrbnySfjZGhodmQ4OXBfMTdjMnhmaG5kYg

rhpot1991

Tue, 04/10/2012 - 00:14

In reply to by Anonymous (not verified)

This isn't really the right place to request help, I'd recommend check out some of the better support channels: http://www.mythbuntu.org/support

You also seem to be doing a lot of things the hard way, install mythbuntu-control-centre and use that for your installation and setup phase, should simplify things. Stop by IRC if you want to talk more.

Anonymous (not verified)

Tue, 04/10/2012 - 11:49

In reply to by Anonymous (not verified)

Mythtv somewhat detects it is crashed and restarts most the time.. I also use mythbuntu depo and upgrade to 24 or 23 and got everything working ...