wjston
February 1st, 2007, 05:34 PM
I am relatively new to Linux and MythTV. I started playing with both back in the early spring because I was interested in Ubuntu as an alternative operating system to Windows. I came across a post explaining MythTV and quickly became quite intrigued with the idea of controlling what to watch on tv and being able to pause/record live tv. After months of tinkering and reinstalling, I can happily say I have two systems that are working quite well. Both systems are frontend/backend configurations.
One issue that I spent many hours researching was the ability to shut down my PVR from within MythTV. From everything that I could find using Google, it is not possible to shutdown a combined frontend/backend myth box unless one returns to the Ubuntu desktop. For the last month, I have successfully been shutting down my Ubuntu system with a "Shutdown" button that I configured in Myth's mainmenu. For anyone interested in setting up their systems to do the same I am including the steps that enabled the shutdown button to finally control my Myth pvr. As I previously mentioned, I am relatively new to linux and I am not sure whether there will be any long term problems that might arise from shutting down the computer from within MythTV - I only know that I haven't had any problems to date.
Adding the Shutdown button: (it is always good to backup the original file just in case things don't end up the way they should).
As myth user:
$ cp /usr/share/mythtv/mainmenu.xml /usr/share/mythtv/mainmenu.xml.backup
$ sudo nano /usr/share/mythtv/mainmenu.xml
Add the following to the end of mainmenu.xml
<button>
<type>MENU_UTILITIES_SETUP</type>
<text>Shutdown</text>
<action>EXEC ~/.mythtv/mythscript/shutdown.sh</action>
</button>
</mythmenu>
Create mythscript directory.
$ mkdir ~/.mythtv/mythscript
Create shutdown script.
$ sudo nano ~/.mythtv/mythscript/shutdown.sh
# ! /bin/bash
# This script will be used to shutdown the computer
# from within MythTV when the myth user selects
# the Shutdown button located on the mainmenu
# This script created on Jan 04 2007
# Shutdown
sudo /sbin/shutdown -h now
exit
Save and exit
Now we need to create a new group called "shutdown"
As Root:
# groupadd shutdown
# nano /etc/group
Add "mythtv" (without quotes) to end of shutdown group
Then
As Root: # visudo
Add: %shutdown ALL= NOPASSWD: /sbin/halt, /sbin/shutdown
## Make Script More Secure
$ sudo chgrp shutdown ~/.mythtv/mythscript/shutdown.sh
Make the script executable only for the group "shutdown"
$ sudo chmod g+x ~/.mythtv/mythscript/shutdown.sh
If everything went well, you should be able to shutdown your system using the shutdown button from within MythTV. I hope this helps those individuals who have been looking to control their pvr's shutdown ablility using a remote. I hope I haven't forgotten any steps as this was over a month ago that I set this up.
ENJOY
One issue that I spent many hours researching was the ability to shut down my PVR from within MythTV. From everything that I could find using Google, it is not possible to shutdown a combined frontend/backend myth box unless one returns to the Ubuntu desktop. For the last month, I have successfully been shutting down my Ubuntu system with a "Shutdown" button that I configured in Myth's mainmenu. For anyone interested in setting up their systems to do the same I am including the steps that enabled the shutdown button to finally control my Myth pvr. As I previously mentioned, I am relatively new to linux and I am not sure whether there will be any long term problems that might arise from shutting down the computer from within MythTV - I only know that I haven't had any problems to date.
Adding the Shutdown button: (it is always good to backup the original file just in case things don't end up the way they should).
As myth user:
$ cp /usr/share/mythtv/mainmenu.xml /usr/share/mythtv/mainmenu.xml.backup
$ sudo nano /usr/share/mythtv/mainmenu.xml
Add the following to the end of mainmenu.xml
<button>
<type>MENU_UTILITIES_SETUP</type>
<text>Shutdown</text>
<action>EXEC ~/.mythtv/mythscript/shutdown.sh</action>
</button>
</mythmenu>
Create mythscript directory.
$ mkdir ~/.mythtv/mythscript
Create shutdown script.
$ sudo nano ~/.mythtv/mythscript/shutdown.sh
# ! /bin/bash
# This script will be used to shutdown the computer
# from within MythTV when the myth user selects
# the Shutdown button located on the mainmenu
# This script created on Jan 04 2007
# Shutdown
sudo /sbin/shutdown -h now
exit
Save and exit
Now we need to create a new group called "shutdown"
As Root:
# groupadd shutdown
# nano /etc/group
Add "mythtv" (without quotes) to end of shutdown group
Then
As Root: # visudo
Add: %shutdown ALL= NOPASSWD: /sbin/halt, /sbin/shutdown
## Make Script More Secure
$ sudo chgrp shutdown ~/.mythtv/mythscript/shutdown.sh
Make the script executable only for the group "shutdown"
$ sudo chmod g+x ~/.mythtv/mythscript/shutdown.sh
If everything went well, you should be able to shutdown your system using the shutdown button from within MythTV. I hope this helps those individuals who have been looking to control their pvr's shutdown ablility using a remote. I hope I haven't forgotten any steps as this was over a month ago that I set this up.
ENJOY