January 1, 0001
— type: post layout: post meta: {} title: MythTV server now starts up and shuts down automatically tags: - Linux - MythTV - Tips and Tricks published: true status: publish — I’ve spent the last few nights playing with the wonderful world of Linux Advanced Configuration and Power Interface (ACPI) so that the MythTV server will now automatically start up to record a scheduled TV show, and automatically shut down afterwards if there are no logged in users. This is pretty cool because it means I won’t miss recording any more of the Americas Cup Highlights because I didn’t get out of bed early enough to turn on the server. It was a pretty arduous task with a number of steps based on content from a number of different web-sites to get things to work. After all the research though it’s not actually that complicated to setup. At a high level the following was done (subsequent blog posts will cover off some of the more tricky bits in more detail):
- Configure Power Management in the BIOS of your machine to allow being resumed by alarm
- Install appropriate bits for Linux to support ACPI
- Alter the Linux configuration so the BIOS uses local time rather than UTC time (since MythTV works using local time)
- Ensure that the ACPI alarm interface works as expected when set
- Create a small script to set the ACPI alarm given a date
- Create a small script to check to see if it is OK to shutdown the server
- Configure MythTV to use the two scripts created above
- Alter the
sudo
permissions for the MythTV user so the scripts can be executed without permission problems - Alter the login permissions so only root can shut the server down (to prevent accidental shutting down when the server is recording