Thursday 6 August 2015

MythTV not running mythfilldatabase on Arch Linux

I run a MythTV PVR server on Arch Linux and have struggled to get mythfilldatabase running automatically as it's supposed to.

In the mythfilldatabase log file the error message was

(Run) - tv_grab_uk_rt  --capabilities failed or we timed out waiting. You may need to upgrade your xmltv graber(Run) - Grabbing XMLTV data using tv_grab_uk_rt is not supported. You may need to upgrade to the latest version of XMLTV.

  • tv_grab_uk_rt is a python script that grabs the the UK Radio Times XMLTV listings
  • mythfilldatabase runs the above (expecting it to be on the path)
  • mythfilldatabase is run from mythbackend
  • mythbackend is run as a systemd service (without the python folder on the path)
Solution was to edit /usr/lib/systemd/system/mythbackend.service to add the following line under the [Service] section:

Environment=HOME=/var/lib/mythtv PATH=/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:$PATH

Which adds the Python path to the environment for mythbackend.  Now tv_grab_uk_rt works fine.