[mythtv-commits] Ticket #3913: After WOL'ing the DB server, mythfrontend connects to wrong host

MythTV mythtv at cvs.mythtv.org
Mon Sep 3 00:45:27 UTC 2007


#3913: After WOL'ing the DB server, mythfrontend connects to wrong host
-------------------------------------+--------------------------------------
 Reporter:  laga+mythtv at laga.ath.cx  |        Owner:  nigel   
     Type:  defect                   |       Status:  assigned
 Priority:  minor                    |    Milestone:  unknown 
Component:  mythtv                   |      Version:  head    
 Severity:  medium                   |   Resolution:          
  Mlocked:  0                        |  
-------------------------------------+--------------------------------------
Changes (by nigel):

  * status:  new => assigned
  * reporter:  anonymous => laga+mythtv at laga.ath.cx


Comment:

 Hi Michael? Sorry I broke this for you. Could I get you to try the
 following patch:
 {{{
 Index: mythcontext.cpp
 ===================================================================
 --- mythcontext.cpp     (revision 14249)
 +++ mythcontext.cpp     (working copy)
 @@ -862,6 +862,7 @@
      QString err;
      QString host = m_settings->GetSetting("DBHostName");
      int     port = m_settings->GetSetting("DBPort").toInt();
 +    QString wake = m_settings->GetSetting("WOLsqlCommand");

      // Deal with missing hostname line, OR one without a value
      if (!host.length())
 @@ -875,6 +876,14 @@
      if (host == "localhost" || host == "127.0.0.1" || host ==
 m_localhostname)
          doPing = false;

 +    // The SQL server may be asleep, so wake it up. Slightly different
 +    // logic to ConnectServer(), which attempts connection before wakeup.
 +    if (doPing && wake.length())
 +    {
 +        myth_system(wake.ascii());
 +        sleep(m_settings->GetNumSetting("WOLbackendReconnectWaitTime",
 0));
 +    }
 +
      if (doPing && !ping(host, 3))  // Fail after trying for 3 seconds
      {
          // Cause MSqlQuery to fail, instead of minutes timeout per DB
 value
 }}}

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/3913#comment:4>
MythTV <http://svn.mythtv.org/trac>
MythTV


More information about the mythtv-commits mailing list