[mythtv] Ticket #4109: LocalHostName should not default to "my-unique-identifier-goes-here"

Nigel Pearson nigel at ind.tansu.com.au
Sun Oct 28 22:29:31 UTC 2007

On 29/10/2007, at 1:11 AM, Daniel Burr wrote:

>>  This breaks backwards compatibility because if somebody updates  
>> mythtv
>>  without adding a value for LocalHostName to their FE and BE  
>> configurations
>>  then they will both break: the BE will refuse to start because  
>> there is no
>>  BackendServerIP corresponding to the hostname "my-unique- 
>> identifier-goes-
>>  here" and the FE will write duplicate entries to the  
>> mythconverg.settings
>>  table with the hostname column set to "my-unique-identifier-goes- 
>> here".

Indeed that is a problem. I just don't know why we haven't
seen it before? (probably something I broke recently)
My proposed fix is:

      params.localHostName = d->m_settings->GetSetting 
("LocalHostName", "");
-    if (params.localHostName.isEmpty())
-    {
-        params.localEnabled = false;
-        params.localHostName = "my-unique-identifier-goes-here";
-    }
-    else
-        params.localEnabled = true;
+    params.localEnabled  = params.localHostName.length() > 0;

which should mean that the gethostname() in LoadDatabaseSettings()
is used for this MythContext, and the default commented line is
written out in mysql.txt.

> There is another case where this causes problems: if the backend(s)  
> and
> frontend(s) share a common mythtv user with a common NFS mounted home
> directory then it is no longer possible to share a single
> ~/.mythtv/mysql.txt

In this case, LocalHostName=localhost is probably correct,
but the above fix should also suffice.
I will test locally before committing today sometime.
If you have time to do the same, I would appreciate it.

Nigel Pearson, nigel at ind.tansu.com.au|
Telstra Net. Eng., Sydney, Australia |
Office: 9202 3900    Fax:  9261 3912 |
Mobile: 0408 664435  Home: 9792 6998 |

More information about the mythtv-dev mailing list