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

MythTV mythtv at cvs.mythtv.org
Sun Oct 28 09:55:47 UTC 2007


#4109: LocalHostName should not default to "my-unique-identifier-goes-here"
------------------------------------------+---------------------------------
 Reporter:  dburr at virginbroadband.com.au  |       Owner:  ijr    
     Type:  defect                        |      Status:  new    
 Priority:  minor                         |   Milestone:  unknown
Component:  mythtv                        |     Version:  head   
 Severity:  medium                        |     Mlocked:  0      
------------------------------------------+---------------------------------
 When MythContextPrivate::WriteSettingsFile writes out a settings file it
 includes the following comment:

 # Set the following if you want to use something other than this
 # machine's real hostname for identifying settings in the database.
 # This is useful if your hostname changes often, as otherwise you
 # will need to reconfigure mythtv (or futz with the DB) every time.
 # TWO HOSTS MUST NOT USE THE SAME VALUE

 However, in MythContext::GetDatabaseParams, params.localHostName is set to
 "my-unique-identifier-goes-here" if LocalHostName is not set, which is not
 what the comment indicates.

 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".

 The fix is to use gethostname(2) in MythContext::GetDatabaseParams to set
 params.localHostName when params.localHostName.isEmpty() is true (line
 3332).  This will make the comment correct and fix backwards
 compatibility.  I can provide a patch if you want but it should be a
 trivial fix.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/4109>
MythTV <http://svn.mythtv.org/trac>
MythTV


More information about the mythtv-commits mailing list