MythTV TIP – Power Button

Every once and a while mythfrontend gets stuck for one reason or another.  Now when this happens I just ssh into the mythbox and restart gdm.  This almost always brings thing back up and running.  While I do usually have my laptop about its still a bit of a pain to break out of TV mode and start sshing in.  Seeing this gave me the idea to put my power button to good use but I felt the script was overly complicated given how well the gdm restart worked.  But since  restarting gdm requires root privileges and thus a password to run I was stymied.  Until I learned about the sudoers file that is.  Editing this file lets you gives users the ability to sudo certain commands without a password – it actually does way more than that but its not relevant to the post.  Now if you are not careful editing sudoers can scrap your system so precede with caution.  Now on to the good stuff.  To edit sudoers use the following command.

sudo visudo

This will apply some basic sanity checking before you save the file; making it every so slightly more difficult to slag your system.  Anyway add the following line. (replace user_name with the user mythfrontend runs under)

user_name ALL=NOPASSWD: /etc/init.d/gdm restart

Make sure to put this at the end of the file otherwise rules may override it.   That took me about half an hour and countless fiddle logout/login cycles.

Now add something like the following your your lirc file.

#Power Button
begin
    remote = remote_name
    prog = irexec
    button = Power
    config = sudo /etc/init.d/gdm restart
end

Now after you logout and log back in your power button should restart gdm allowing you to ‘fix’ any frontend hanging issues from your remote.

*Note – This tip has no warranty or support.  If it deletes your files or blows up your computer don’t come crying to me.

MythTV Tip – MythWeb Memory Limit

Once you start getting more than 150 recordings you start hitting the memory limit of 32MB when you try to view all recordings in Mythweb.  The obvious solution is to just up the memory limit but its not obvious where to do that – at least not to me.  After some searching I found this post.  Which gives the correct location(at least for me on Mythbuntu 8.10) /etc/mythtv/mythweb-config.php.  Then I just upped the limit to 64MB so I figure I’ll be good till around 300 recordings. Obviously you can increase it even higher if you like. 

As an aside I imagine it is the on demand creation of all the thumbnails that sucks up all the memory.

*Note – This tip has no warranty or support.  If it deletes your files or blows up your computer don’t come crying to me.