MYTHCONFDIR

From MythTV Official Wiki
Jump to: navigation, search

MYTHCONFDIR is an environmental variable used by MythTV programs.

Background

HOME is frequently used to locate a configuration directory known as .mythtv. And from there, things like channels, themes and config.xml. However, it's not the only way to accomplish this.

Use

MYTHCONFDIR is an alternative to HOME and its value overrides the value of HOME. In fact, HOME isn't required, nor is a mythtv home directory. All MythTV programs, e.g. mythbackend mythfrontend, mythfilldatabase..., honor the value of MYTHCONFDIR. The same for MythTV bindings. Portable 3rd party scripts/tools should use MYTHCONFDIR, especially if they use information from config.xml.

Practical example

  • In the mythtv-backend.service:
Environment=MYTHCONFDIR=/var/lib/mythtv/confdir
(a similar method could be used in other init scripts/tools)
  • The backend runs as user mythtv (User=mythtv in a .service)
  • A mythtv user exists and belongs to a group with the same name
  • Any other MythTV user should be a member of the mythtv group
  • Directories/Files under $MYTHCONFDIR (that need to be changed by other users) should have group write permission
  • In all MythTV users' .profile or .bashrc ...:
export MYTHCONFDIR=/var/lib/mythtv/confdir

The above lets users preserve the conventional value of HOME while allowing MythTV software to find important information in another location.