Config.xml

From MythTV Official Wiki
Jump to: navigation, search

Important.png Note: The correct title of this article is config.xml. It appears incorrectly here due to technical restrictions.


The file is used multiple times:

  1. By the backend to find the MySQL database - otherweise a built-in default is used: [778249a]cgitgithub
  2. By the frontend to find its backend; otherwise the frontend tries to find a backend using UPnP.
  3. By other mythProgramsNames to locate the backend e.g. mythshutdown.

Depending on the distribution and or local choices, the file may be found in: /etc/mythtv/config.xml, ~/.mythtv/config.xml or ~mythtv/.mythtv/config.xml etc.

The proper way to get the actual location is to look under $HOME/.mythtv of the user running a MythTV program. Typically, the user that runs the backend is mythtv. Frontends may be run as the login user name. Note that if MYTHCONFDIR is set, it overrides the setting of HOME.

To find which environmental variable is used, and therefore the actual location, users should look at the values of HOME and possibly MYTHCONFDIR of the program being run. This includes any scripts/systemd .system files/Upstart .conf files. If a program is being run from the command line, simply type: echo "HOME=$HOME, MYTHCONFDIR=$MYTHCONFDIR" to see what's set.

Before 0.26, mysql.txt was used. It is no longer required by MythTV. It is possible that some non-compliant 3rd party programs still reference it. MythTV 0.26.

Template

The following template can be found in mythtv/contrib/config_files/config.xml

<Configuration>
  <UPnP>
    <UDN>
      <MediaRenderer>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</MediaRenderer>
    </UDN>
  </UPnP>
  <LocalHostName>my-unique-identifier-goes-here</LocalHostName>
  <Database>
    <PingHost>1</PingHost>
    <Host>127.0.0.1</Host>
    <UserName>mythtv</UserName>
    <Password>mythtv</Password>
    <DatabaseName>mythconverg</DatabaseName>
    <Port>3306</Port>
  </Database>
  <WakeOnLAN>
    <Enabled>0</Enabled>
    <SQLReconnectWaitTime>0</SQLReconnectWaitTime>
    <SQLConnectRetry>5</SQLConnectRetry>
    <Command>echo 'WOLsqlServerCommand not set'</Command>
  </WakeOnLAN>
</Configuration>

Description

LocalHostName
The unique name used to look-up host-specific settings. By default the hostname is used and this shouldn't be changed, but it can be useful to overwrite this when the hostname is changed or multiple frontends with different configurations should run on the same host.

Univeral Plug and Play

UPnP/UDN/MediaRenderer
The UUID used for the MythTV frontend, when used as a UPnP media renderer.
UPnP/MythFrontend/DefaultBackend/*
These settings are deprecated by the settings below mythtv/libs/libmyth/mythcontext.cpp.

Database

All configuration data is stored in a central MySQL database, which must be reachable for all MythTV components.

PingHost
1=MythTV should try to test-ping the host running the database using ICMP echo-request before actually connecting the database process; usually 1.
Host
The hostname, IPv4 or IPv6 address of the host, where the database is running.
UserName
The name of the account used to authenticate against the database; usually mythtv.
Password
The password used to authenticate.
DatabaseName
The name of the schema of the database; usually mythconverg.
Port
The TCP port number, where the database is running on; usually 3306.

WakeOnLAN

If the database is unreachable, MythTV can try to wake up the host using for example Wake-on-LAN.

Enabled
1=MythTV should try to wake up the host. PingHost=1 must be set as well!
SQLReconnectWaitTime
Seconds to wait between reconnection attempts.
SQLConnectRetry
Number of times to retry; usually 5.
Command
Command to use to wake server; for example sudo etherwake xx:xx:xx:xx:xx:xx.