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):

  1. Configure Power Management in the BIOS of your machine to allow being resumed by alarm
  2. Install appropriate bits for Linux to support ACPI
  3. Alter the Linux configuration so the BIOS uses local time rather than UTC time (since MythTV works using local time)
  4. Ensure that the ACPI alarm interface works as expected when set
  5. Create a small script to set the ACPI alarm given a date
  6. Create a small script to check to see if it is OK to shutdown the server
  7. Configure MythTV to use the two scripts created above
  8. Alter the sudo permissions for the MythTV user so the scripts can be executed without permission problems
  9. Alter the login permissions so only root can shut the server down (to prevent accidental shutting down when the server is recording
comments powered by Disqus