You are here

Restart MythTV frontend via Remote

Error message

  • Warning: include_once(/home/rhpot1991/sites/baablogic/www/drupal/sites/all/modules/mollom/mollom.module): failed to open stream: Permission denied in drupal_load() (line 1112 of /home/rhpot1991/sites/baablogic/www/drupal/includes/bootstrap.inc).
  • Warning: include_once(): Failed opening '/home/rhpot1991/sites/baablogic/www/drupal/sites/all/modules/mollom/mollom.module' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in drupal_load() (line 1112 of /home/rhpot1991/sites/baablogic/www/drupal/includes/bootstrap.inc).

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.

Comments

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

In 9.10 you shouldn't need to add irexec to startup. Not quite sure about the other releases at this point.

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

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.

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

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.

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 ...

Add new comment

(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.